Jump to content

Recommended Posts

Posted

I want to add printers using the script on the wiki but want it to the use the location on the location tab in AD rather than the computer name.

 

Is that possible?

 

Eg if location is R40 then add printers x & y

Posted

would something like this work? Ive hardly used vb so not sure, just found it on google!

 

Set objComputer = GetObject _
   ("LDAP://CN=DCNAME,DC=SCHOOL,DC=local")

objProperty = objComputer.Get("Location")
If IsNull(objProperty) Then
   Wscript.Echo "The location has not been set."
Else
   Wscript.Echo "Location: " & objProperty
   objProperty = Null
End If

 

Where school.local is my domain name.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...