Link to home
Create AccountLog in
Avatar of BigBadWolf_000
BigBadWolf_000Flag for United States of America

asked on

Vbscript to map printers by computer group names using 'case' 2008 domain

Have severan computers in and OU and they are members of group AB_Printers

Need vbs script to map printers using the computer group name in ADDS 2008
(yes I know I can use GPO....but I am asking for vbs) I know hot to do it for users, but need syntax to do it for computer group name using

user example : need correct syntax for computer name object
UserString = WshNetwork.UserName
Set UserObj = GetObject("WinNT://" & DomainString & "/" & UserString)

For Each GroupObj In UserObj.Groups
    Select Case UCase(GroupObj.Name)
        Case "AB_Printers"
Avatar of yo_bee
yo_bee
Flag of United States of America image

Why not use GPP and leverage Item Level Targeting to deploy your printers.

Here is an article I wrote that can may help.

https://www.experts-exchange.com/Software/Server_Software/File_Servers/Active_Directory/A_11321-Deploying-Printers-using-Group-Policy-Preferences.html
ASKER CERTIFIED SOLUTION
Avatar of RobSampson
RobSampson
Flag of Australia image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of BigBadWolf_000

ASKER

Wanted a solution with "case" ....thanks however, the "computername" object helped me resolve my Duh! moment :D
@Wolf.

Did you look at my suggestion? From what I see that you are looking to accomplish you have more control with greater ease using GPP.

Please let me know if you even considered it.