+ Post New Thread
Results 1 to 2 of 2
Scripts Thread, Printing Based on Location in AD in Coding and Web Development; I want to add printers using the script on the wiki but want it to the use the location on ...
  1. #1
    DSapseid's Avatar
    Join Date
    Feb 2007
    Location
    West Sussex
    Posts
    1,152
    Thank Post
    130
    Thanked 54 Times in 47 Posts
    Rep Power
    38

    Printing Based on Location in AD

    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

  2. #2
    DSapseid's Avatar
    Join Date
    Feb 2007
    Location
    West Sussex
    Posts
    1,152
    Thank Post
    130
    Thanked 54 Times in 47 Posts
    Rep Power
    38
    would something like this work? Ive hardly used vb so not sure, just found it on google!

    Code:
    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.

SHARE:
+ Post New Thread

Similar Threads

  1. AD: Block user settings GPO inheritance based on computer location
    By morganw in forum Windows Server 2000/2003
    Replies: 0
    Last Post: 23rd October 2009, 11:48 AM
  2. ESXi 3.5 into 4 upgrade problem in adding Existing VMFS partition on iSCSI SAN
    By albertwt in forum Thin Client and Virtual Machines
    Replies: 4
    Last Post: 27th May 2009, 07:31 AM
  3. Creating mailboxes in exchange 2007 when a user is created in AD on another server
    By thesk8rjesus in forum Network and Classroom Management
    Replies: 2
    Last Post: 5th September 2008, 02:53 PM
  4. Mapping Printers based on Location
    By NeoNemesis in forum Windows
    Replies: 11
    Last Post: 6th August 2007, 08:03 AM
  5. Setting Printers Based On Room Location
    By ICTNUT in forum Scripts
    Replies: 34
    Last Post: 13th May 2006, 08:19 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •