Category: PowerShell5.1
-

Update-Windows_Powershell.ps1
Updates Windows powershell modules, installs any not installed, and updates help for them all
-

Get ALL A User’s Groups
…get every group a user is in, including the Primary
-

Get Domain Users
The reason you cannot enumerate all ‘Domain Users’ members is due to size restrictions of the PowerShell commands,
-

VM PS Templates: Query VMs PoweredOn
This script renumerates through all the VCSAs and makes a big list of the PoweredOn VMs and runs a job against them, like TC (ping)
-

Get-ADGroup WildCard is BROKEN
In the past (2018) you could use ‘like’ on Get-adgroup, like this:
-

PS Script to Promote 2019 Server to RWDC
Add-WindowsFeature -Name “AD-Domain-Services” -IncludeManagementTools:$False -Confirm -ea Inquire -LogPath “C:\Users\$env:username\Documents\WindowsPowerShell\log\$day-RWDCPromo.log”
-

Set-MpPreference
As you can see, Microsoft’s syntax is wrong:They show the syntax for setting soft-passive mode as ‘Set-MpPreference -DisableRealtimeMonitoring $true’ when it is ‘Set-MpPreference -DisableRealtimeMonitoring:$true’ <– NOTE THE COLON??? Arrrrgghhhh! I cannot tell you how frustrating it is when code is not written to give you ANY response unless you get the syntax EXACTLY right. *SIGH*…
-

Gpupdate Latency Errors Lookup Script
I cannot TELL you how hard this was to write. Holy smokes the help on this is terrible.
-

Locate Pervasive Lockouts of AD Accounts
You can use PowerShell to search the Security event log for lockout events…
-

PowerShell: Install ActiveDirectory Easily
I have found this make installing the ActiveDirectory Module FAR easier.Quick.Painless.
-

PowerShell/PowerCLI: UMount All ISOs At Once
Get-VM -Name $vm | Get-CDDrive | Set-CDDrive -NoMedia -StartConnected $false
-

ChatGPT-AzureAI:Tail in Windows
To use this function, simply call it with the path to the file you want to tail and the number of lines you want to show: tail “C:\Path\To\File.txt” 10
-

PowerShell: Check your local server performance
Collects performance data for 30 seconds and exits
-

PowerShell: Copy $Profile to every Windows Server
…Just remember to put your domain in for the ‘-SearchBase’
-

PowerCLI: Add Hot Add / Hot Plug Status to a Specific VM Guest
Add Hot Add / Hot Plug Status to a specific VM Guest
-

Check Wildcarded AD User Properties with PowerShell 5.1
Get all user properties, or just one, with a wildcard
-

100 count restrictions in PowerShell and PowerCLI
Now why do ya think this may be so, there, now, yet?
-

Remove that annoying top output line
HOWTO get that annoying top line off the output of PowerShell exports
-

PowerShell: Make a list of every account that connected to a server in the last 30 days
Gets every connection made, but only the last one, in the last 30 days
-

Install Any Command Easily in PowerShell
That’s how you would install ANY module for a command you need. Now TELL me that’s not convenient!
-

Our Azure Resource Group, Tenant, and Subscription Questions to ChatGPT.org
Azure RGs, Subscriptions and Tenants can get confusing; This Q&A my son Ryan and I asked ChaGPT.org, during our AZ-104 training, should help.. Can an Azure Subscription be accessible by multiple tenants? And why?In Azure, can there be multiple subscriptions in a tenant? Can users access multiple subscriptions? How?
-

Why is the Interactive PowerShell 5.1 So Limited?
I have discovered that the interactive powershell in version 5.1 is badly limited.
-

Windows Server 2019 Safe_OS Error Correction Poll
…did you just bail to a new build?
-

HOWTO: Discover Where a LOCAL ISO is Mounted – Windows Server 2016/2012R2
..the ISO still throws the “Sorry…” error
