Link to home
Start Free TrialLog in
Avatar of efrenmartinez
efrenmartinez

asked on

Disable Account and Hide from Exchange address book

Hello Alll
i am trying to get a vbscript to disable a user account  and also hide from exchange address book i am currently using this to disable but cant figure out how to hide from exchange address book from the command line any suggestions??
dsquery user -name namehere -limit 0 | dsmod user -disabled yes -a batch file


 
ASKER CERTIFIED SOLUTION
Avatar of Andrew Davis
Andrew Davis
Flag of Australia 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 Hayes Jupe
just wrote a vbscript and use the
MSExchHideFromAddressLists = TRUE
property.
if you want to disable the account you need to change line 33 to

         objUser.AccountDisabled = TRUE

Cheers
Avatar of efrenmartinez
efrenmartinez

ASKER

Worked great had to modify some but it was simple enough, thanks for you help :) , now time to add to remove groups hehe
hey andrew do you think it is possible to add to remove all groups accept primary which is domain userS?
please ignore last comment, how can we filter it also like if in group Domain Admin exclude? i will open a new question if you like :)