Link to home
Start Free TrialLog in
Avatar of Mike Satterfield
Mike Satterfield

asked on

VB Login Script that removes the user logging in from specific AD group

I am not a great coder, and am a bit under a time crunch. I am writing a login script that needs to, check if the user is part of a specific group, delete all network printers if they are, then remove that user from the group.

I have the first two parts working, but am not having an easy time removing the user form the group. I do understand the users will need the proper AD permissions, I am testing with a Domain administrator account now. I am attaching what I have so far:
      
Thanks,

login-script-test3.vbs
ASKER CERTIFIED SOLUTION
Avatar of Joseph Moody
Joseph Moody
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mike Satterfield
Mike Satterfield

ASKER

Appended it, and configured values, errors out with " The server is unwilling to process the request."

on the line:
objGroup.Remove("LDAP://" & objADSysInfo.ComputerName)

I do have the group, having self add/remove rights, as well as the user, in the groups permissions. .. Am I missing something else rigths wise ?

Thanks,
nevermind.. .just needed to swap computername with username.. everything works great.. then thanks.
Great!