The PowerShell ISE sports a zoom slider at its lower right edge, and you can control this slider with PowerShell code. So you could set defaults for it in your $profile script: $psise . Options . Zoom = 120 Or, write some code to keep your colleagues...

If you do not have PowerShell 5.0 and .NET Framework 4.5 is not available, here is an approach to unzip ZIP files that uses the native Windows shell support. If you have installed custom ZIP file extensions for the explorer, this approach may not work...

ZIP file support was introduced in PowerShell 5.0, but if you have installed the .NET Framework 4.5 and possibly want more control over the unzipping process, try this: #requires -Version 2 # .NET Framework 4.5 required! Add-Type -AssemblyName System...

In a previous tip we showed how you can test the network port of a computer. When you have installed the free RSAT tools from Microsoft, you could query your Active Directory and get a list of all computer accounts, or all computer accounts in a given...

To see whether you can access a remote computer via a given network port, here is a test function called Test-Port; it takes a remote computer name (or IP address), and optionally a port number and timeout. The default port is 5985 which is used for PowerShell...

In a previous tip we explained how you find the physically logged on user. In this tip you will see how you can list the current logon sessions, reporting all users who are currently logged on to a system. This includes users that are connected via RDP...

There can always be only one physically logged on user on a machine. The physically logged on user is the one sitting right at the machine. Here is a PowerShell function that reports the physically logged on person for a local or remote system. To access...

In a previous tip we explained how you can construct the connection string to a SQL database. Whether you use this to create the connection string, or whether you create a connection string from scratch does not matter – provided you have a valid...

If you’d like to contact an SQL Server database via PowerShell, you need a connection string. The connection string contains all pieces of information needed to contact the SQL server instance. Traditionally, it is not trivial to construct such...

If you have installed the free RSAT tools from Microsoft, you can use PowerShell to update information stored in your AD user account, for example your office phone number. Whether you are allowed to commit this change depends on your enterprise security...

If you’d like to add custom attributes to an AD object, simply use a hash table, and add the desired attribute names and their values. Then use Set-ADUser (available in the ActiveDirectory module shipping with the free RSAT tools from Microsoft...

Whenever you add delegation rights to an AD object (i.e. allow a user to manage the members of an organizational unit), you really invoke a change of security settings for the given AD object. AD security descriptors can be very complex. Cloning AD security...

The built-in PowerShell ISE editor that ships with PowerShell 3.0 or better can be customized, and you can add your own menu items. When you run the following code, you will find a new menu item “Get Command History” in your Add-ons menu that...

Provided you have downloaded and installed Microsoft’s free RSAT tools, managing AD groups and group members is very simple. Here are some lines of code that can serve as examples on how to get started: #requires -Version 1 -Modules ActiveDirectory...