Use PowerShell to Bulk Replace Logon Scripts for Active Directory Users

With Quest Software’s free set of Active Directory (AD) cmdlets, changing the logon script for a particular set of AD users can be accomplished with just one PowerShell command.

Kaare Moe

January 23, 2012

1 Min Read
ITPro Today logo in a gray background | ITPro Today

I had to change the logon script for a select group of users who had a particular logon script configured in their Active Directory (AD) profiles. I discovered that this task is easy to accomplish using Quest Software’s ActiveRoles Management Shell for Active Directory, which provides a free a set of cmdlets for AD. You just need to use the Get-QADUser cmdlet with the -LogonScript argument to list all users configured with the old script, then pipe the results to the Set-QADUser cmdlet with the -LogonScript argument to replace the old logon script with the new one. The command looks like

Get-QADUser -LogonScript OldFile |  Set-QADUser -LogonScript NewFile

 

where OldFile is the old logon script and NewFile is the new logon script. You can download the free ActiveRoles cmdlets at  Free PowerShell Commands for Active Directory.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like