Find which users stay with the oldest passwords in Workgroup/Domain Computers

Updated: As of Feb 2022, I have fixed/updated the script so that it runs faster in workgroup computers. The changes as marked in the Changed Log section of the script. Moreover, you can run the script with -WriteVerbose  switch to see the execution time.

Sometimes, you need to know which users are in local admin group or specific group on remote computers. The windows built-in command Net User give us a good way to get password information for local or domain users. Using net user /domain switch will show the domain group membership info but it will be truncated to 20 characters for long group names. So, I’ll use ‘net user’ output and query the WMI to make a script to find user account & password info in either local or domain environment. Continue reading “Find which users stay with the oldest passwords in Workgroup/Domain Computers”

Script to Join Active Directory Domain with Local user Profile migration

Writing a long, quality script can be both a tiresome and interesting task in terms of its look and feel. It’s been quite a while since I last wrote a substantial script, as I’ve mostly been occupied with small utility scripts in my work. Today, I completed a very useful script that joins local users to domain users with automatic profile migration for the current user. This ensures the retention of current local user settings, such as wallpaper, Internet Explorer settings, Power Option Settings, and desktop items, in their new domain environment. Optionally, you can choose not to migrate. Continue reading “Script to Join Active Directory Domain with Local user Profile migration”

How to restart Windows at Any Scheduled time with Powershell

As a system administrator, there are times when you need to schedule a restart for server maintenance. While PowerShell’s Restart-Computer cmdlet is handy, it doesn’t offer a built-in parameter for timing the shutdown. This means you’d typically need to combine it with New-ScheduledTask, which is only available in PowerShell 3.0 and later.

But let’s keep it simple. Instead of relying on newer PowerShell features, you can use the built-in shutdown.exe utility. By combining shutdown.exe with a PowerShell command, you can easily schedule a restart.

Continue reading “How to restart Windows at Any Scheduled time with Powershell”