Admins use these resources to configure components, such as registry keys and Windows services, or to create and manage local users through a configuration script. For instance, the File resourcemanages files an
Switch statements function along the same general lines as an if statement, but enable us to configure a more complex set of actions based on the conditions we find. We can make our process checker a bit more capable by using a switch: $processes = Get-Process switch -regex ($processes)...
How to handle close event of PowerShell window if user clicks on Close('X') button how to handle directories with special characters in their name How to hide all output from commands but display error mesages How to hide all PS code and results from the screen while running except for Wr...
Figure 5 Using the New-MaintenanceWindow cmdlet (Click the image for a larger view)Boris Yanushpolsky, Program Manager on the Microsoft OpsMgr team, has provided some very handy Windows PowerShell code that can be used to set all objects that refer to a computer into maintenance mode, ...
Configure IPsec tunnel mode The following command creates an IPsec tunnel that routes traffic from a private network (192.168.0.0/16) through an interface on the local computer (1.1.1.1) attached to a public network to a second computer through its public interface (2.2.2.2) to another private...
A PowerShell prompt window opens that’s nearly identical to the traditional command prompt window of Windows XP, Windows Server 2003, and their many ancestors. The PS C:\Documents and Settings\Lee> prompt indicates that PowerShell is ready for input, as shown in Figure 1. Figure 1. Windows...
Masquerade-PEB uses NtQueryInformationProcess to get a handle to powershell's PEB. From there it replaces a number of UNICODE_STRING structs in memory to give powershell the appearance of a different process. Specifically, the function will overwrite powershell's "ImagePathName" & "CommandLine...
In an elevated PowerShell window (all users): PowerShell Copy Install-Module -Name ExchangeOnlineManagement Only for the current user account: PowerShell Copy Install-Module -Name ExchangeOnlineManagement -Scope CurrentUser To see the available Preview versions of the module, run the following...
Configure IPsec tunnel mode The following command creates an IPsec tunnel that routes traffic from a private network (192.168.0.0/16) through an interface on the local computer (1.1.1.1) attached to a public network to a second computer through its public interface (2.2.2.2) to anoth...
Configure IPsec tunnel mode The following command creates an IPsec tunnel that routes traffic from a private network (192.168.0.0/16) through an interface on the local computer (1.1.1.1) attached to a public network to a second computer through its public interface (2.2.2.2) to another private...