If you joined us at our live webcast this last Thursday (October 13, 2016 as of this posting) you were introduced to some nifty PowerShell scripts which we want to make available to you. If you missed the webcast, click the video below and get caught up! First, we discuss getting your environment ready for using remote PowerShell, then we dive into favorite scripts.
Don’t miss another free webcast by signing up for email notices here.
Preparing Your Environment for Remote PowerShell
Enabling WinRM
Command prompt or PowerShell:
winrm quickconfig -force -q
PowerShell only:
Enable-PSRemoting -Force
This will only setup the basic configuration for WinRM. If you want to take it a step further and secure it with a certificate, you could use this wonderful gem as a starting point: enable WinRM using a certificate.
Auto Login
Sometimes we have a need to have a machine automatically login with a specific user when the machine boots up. These scripts will help get that configured. Please note that each script includes a line that will reboot the target machine.
Setting up Auto Login for a Machine
Removing Auto Login for a Machine
Resolving Trust Relationship Issues
$Credential = Get-Credential Test-ComputerSecureChannel -Repair -Credential $Credential
Reset-ComputerMachinePassword
Fixing Windows Update Service
Set-Service -Name wuauserv -StartupType Automatic Start-Service -Name wuauserv
Delete and/or Copy Files
Deleting temp files for current and all users
Copying files to all user paths
Getting IP Configuration Settings
Sometimes we just need a quick way to grab network adapter settings for a machine. Here are a couple of examples to do it for a machine. The first example can be used in a PDQ Deploy package or via a PDQ Inventory Remote Command. These ensure that a command is run locally on a target machine. The second example could be used from a PDQ Inventory Custom Tool or even straight up from a PowerShell window (fancy).
Getting network adapter info locally
Getting network adapter info using Invoke-Command
Links Referenced in the Webcast
Definitely check out Stephen Valdinger’s blog on automating software installs for imaged computers.
Awesome PowerShell Commands List
Using PowerShell to Set Static and DHCP IP Addresses
Information on Microsoft easy fixes
The post Prepare Your Environment for Remote PowerShell appeared first on Admin Arsenal.