Ok I got something working but when I started to add my other groups I error out at a certain point.
Now I get a ERROR Code "Wrong number of Arguements or invalid property assignment Code: 800A01C2
Option Explicit
Dim objNetwork, objUser, CurrentUser
Dim strGroup
Const Accounting =...
tsuji I run he script below and I get "The directory property cannot be found in the cache" Line 8 Char 1
Any Clues
Const IT = "groupType=it"
Const Accounting = "groupType=accounting"
Const BusDev = "groupType=busdev"
Set objNetwork = CreateObject("WScript.Network")
Set ADSysInfo =...
Thanks tsuji I'll test it out when I get to work
I was also reading about this statement which can be useful
SELECT Name FROM LDAP://cn=Users, dc=xxxxxxxx, dc=com WHERE _& objectCategory=group AND groupType=2
From this Site...
I need it to search within the Users Security Settings illustration below
____________________________
NOT COMPUTER SETTINGS
------------------
CN=DIXON,OU=Computers,OU=Deerfield,DC=xxxxxxxxx,DC=xxxxxxxx,DC=com
Last time Group Policy was applied: 8/24/2007 at 1:36:15 PM
Group Policy...
1./1.1 Well I gather the gpresult from a different user today and the infomation came up has
CN=Persons Name,OU=Users,OU=Deerfield,DC=XXXX,DC=xxxxxx,DC=com
This User's belongs to these Security Groups
Domain Users
Everyone
BUILTIN\Administrators
BUILTIN\Users...
To add I also change all the WSHPrinter to objPrinter and I put a WScript.Echo "PrinterAdded" Shown Below and it did display but I checked my Printers and they were not added instead I logged into the Print Server and and under the printer and faxes it seemed to have added in there with example...
This is the Program as of now. It Run but still did not install the corresponding printers
Dim objNetwork
Dim objPrinters
Dim ADSysInfo
Dim ComputerName
Dim objComputer
Set objNetwork = CreateObject("WScript.Network")
Set objPrinters = objNetwork.EnumPrinterConnections
Set ADSysInfo =...
So mrmovie I should change Set ComputerName = GetObject("LDAP://" & ADSysInfo.ComputerName)
to
Set objComputer = GetObject("LDAP://" & ADSysInfo.Computer)
and change every If Instr(ADSysInfo.ComputerName, "OU=XX")
to
If Instr(ADSysInfo.Computer, "OU=XX")
what about the OU=XX will that...
If Instr(ADSysInfo.ComputerName, "OU=PV") Then
I need to remove the OU statement and replace it to look elsewhere for the Security Group Can you illustrate for me.
For instance when I get my gpresults which is
USER SETTINGS
--------------
CN=Christopher...
SORRY for the bad English Repost
Thanks mrmovie I just found out from a colleague that we do not use OU and that search by Member Of within Active Directory so I have to re-structure the code. would any1 have knowledge on that?
Thanks mrmovie I just found of from a colleague that we do use OU and that if I were to search within Active Directory is Members Of so I have to re-structure the code. would any1 have knowledge on that?
I seemed to had resolved my issue with Expected END but when the Script execute just Locally on my machine I have not yet applied it to AD and I know that I'm in a OU why is it not added the corresponding printers?
This is the Actually Code below
Dim objNetwork
Dim objPrinters
Dim ADSysInfo
Dim ComputerName
Set objNetwork = CreateObject("WScript.Network")
Set objPrinters = objNetwork.EnumPrinterConnections
Set ADSysInfo = CreateObject("ADSystemInfo")
Set ComputerName = GetObject("LDAP://" &...
Dim objNetwork
Dim objPrinters
Dim ADSysInfo
Dim ComputerName
on error resume next
Set objNetwork = CreateObject("WScript.Network")
Set objPrinters = objNetwork.EnumPrinterConnections
Set ADSysInfo = CreateObject("ADSystemInfo")
Set ComputerName = GetObject("LDAP://" & ADSysInfo.ComputerName)...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.