Login | |
|
 |
Need help with Script. - 2/24/2005 6:48:24 AM
|
|
 |
|
| |
alienprotein
Posts: 44
Score: 0
Joined: 2/23/2005
From: USA
Status: offline
|
I am new to vb script, but feel I have a decent grasp on it. I have the following script that mapps printers, and shares based on group membership. I have an issues with this script, and wanted to get some feedback. 1. I have been successfull at getting it to run on our windows 2000 machines, and had good success with XP SP1, but now I am having issues with Windows XP SP2. The script will install the "Non-Group" assigned items, but when I get to the group assigned items I get the following error: Script: test.vbs Line: 60 Char: 5 Error: Windows cannot open this program because it has been prevented by a software restriction policy. For more information, open event viewer or contact your system administrator. Code: 800704EC Source:(null) I have the software restriction policies for my Test OU set to allow vbs to run on this specific mechine, as well as from the SYSVOL share. Windows Firewall, and security center are both disabled, so I know that is not the cause. I can not figure out why the "non-group" associated resources are getting installed without error, but when I get to the Group associated items it generates the above error. Has anyone seen this? If so, how do I resolve this? Option Explicit Dim objNetwork, objUser, Dim WScript, net, WshNetwork Dim currentuser, strGroup Set objNetwork = CreateObject("WScript.Network") ' Forces script to skip errors ' On Error Resume Next Set objUser = CreateObject("ADSystemInfo") Set currentuser = GetObject("LDAP://" & objUser.UserName) strGroup = LCase(Join(currentuser.MemberOf)) '************************* '*Install Global Printers* '************************* Set net = CreateObject("WScript.Network") net.AddWindowsPrinterConnection "\\DA2UTL01\McK-15", "McK-15 (Color)" net.AddWindowsPrinterConnection "\\DA2UTL01\McK-20", "McK-20 (High Speed)" net.AddWindowsPrinterConnection "\\DA2UTL01\McK-30", "McK-30 (High Speed)" net.AddWindowsPrinterConnection "\\DA2UTL01\McK-40", "McK-40 (High Speed)" '************************************************* '*NETWORKDRIVES THAT ARE AVAILABLE FOR EVERY USER* '************************************************* objNetwork.MapNetworkDrive "q:", "\\da1fls01\files" objNetwork.MapNetworkDrive "H:", "\\Da1DC101\home\" & objNetwork.UserName objNetwork.MapNetworkDrive "G:", "\\Da2fls02\working_files" '******************************************** '*Installs Printers for the Tech Files group* '******************************************** If InStr(strGroup, "cn=Tech Files") Then net.AddWindowsPrinterConnection "\\DA1UTL01\AK-73 (TF)", "AK-73 (TF)" net.AddWindowsPrinterConnection "\\DA1UTL01\AK-74 (Color)", "AK-74 (Color)" net.AddWindowsPrinterConnection "\\DA1UTL01\AK-75 (TF)", "AK-75 (TF)" net.AddWindowsPrinterConnection "\\DA1UTL01\AK-77 (MF)", "AK-77 (MF)" End If '***************************************** '*Installs Printers for the Medical Group* '***************************************** If InStr(strGroup, "cn=Medical") Then net.AddWindowsPrinterConnection "\\DA1UTL01\AK-80 (Medical)", "AK-80 (Medical)" net.AddWindowsPrinterConnection "\\DA1UTL01\AK-79 (medical)", "AK-79 (medical)" End If '******************************************* '*Installs Printers for the 7th Floor Users* '******************************************* If InStr(strGroup, "cn=Test") Then net.AddWindowsPrinterConnection "\\DA1UTL01\AK-82 (Color)", "AK-82 (Color)" net.AddWindowsPrinterConnection "\\DA1UTL01\AK-83 (7th)", "AK-83 (7th)" End If 'Concordance - Note Only Concordance indexing users are assigned to this group. If InStr(strGroup, "cn=Index QC") Then objNetwork.MapNetworkDrive "k:", "\\DA2fls01\Test" objNetwork.MapNetworkDrive "I:", "\\DA1fls01\images" objNetwork.MapNetworkDrive "o:", "\\DA1fls01\ocr" End If
|
|
| |
|
|
|
 |
Re: Need help with Script. - 2/24/2005 7:44:53 AM
|
|
 |
|
| |
mbouchard
Posts: 1856
Score: 14
Joined: 5/15/2003
From: USA
Status: offline
|
What errors are being reported in event viewer?
|
|
| |
|
|
|
|
|