daknetworks.com

You are here: Blog Set Logon Script For Everyone in Domain With Powershell | Set Logon Script For Everyone in OU With Powershell

Set Logon Script For Everyone in Domain With Powershell | Set Logon Script For Everyone in OU With Powershell

Set Logon Script For Everyone in Domain | Set Logon Script For Everyone in OU

Good morning class! Today, let's set the LOGON SCRIPT for everyone in a domain or in an OU:

-run powershell (as admin)

To clear the value:

-type: get-aduser -filter * -searchbase "ou=<location>,ou=<users>,dc=<domain-name>,dc=com" |set-aduser -clear scriptpath

To set the value:

-type: get-aduser -filter * -searchbase "ou=<location>,ou=<users>,dc=<domain-name>,dc=com" |set-aduser -scriptpath "<file-name>"

Or for a single user:

-type: set-aduser foo.user -clear scriptpath

-type: set-aduser foo.user -scriptpath <file-name>

(ie: set-aduser foo.user -scriptpath ls)

What About More? I Want More! Like the Home Folder?

Now I already know what you are going to ask... "Can I set the HOME FOLDER as well?"

YES!!! It's a little complicated so it is in another article here: http://www.daknetworks.com/index.php/blog/390-how-to-setup-home-drives-home-folders-and-login-scripts

Contact Dak Networks

Please contact us at the following.