Browsed by
Category: PowerShell

Manage Virtual Machines Using Windows PowerShell Direct

Manage Virtual Machines Using Windows PowerShell Direct

Coming with Windows Server 2016, PowerShell Direct is a new feature which gives you a way to run Windows PowerShell commands in a VM from the host. Windows PowerShell Direct runs between the host and the VM. This means it doesn’t require networking or firewall requirements, and it works regardless of your remote management configuration. Windows PowerShell Direct works much like remote Windows PowerShell except that you do not need network connectivity. To connect to the VM from a host,…

Read More Read More

Remove List of SCOM Orphaned Agents in PowerShell

Remove List of SCOM Orphaned Agents in PowerShell

I faced this need for a customer need, so I wanted to share with you this little article. In order to remove a list of SCOM orphaned agents (e.g. computer doesn’t exist anymore) you can use this script. Obviously, it will only remove agents from SCOM console, but it will not uninstall agent from the computer (we will see how to manage this in another article).

You can actually use either a plain list of gray agents or .csv file as…

Read More Read More

Access SQL Server (Integrated Security) with Different Windows Credentials in PowerShell

Access SQL Server (Integrated Security) with Different Windows Credentials in PowerShell

I needed to get data out of a SQL Server instance that used integrated windows security through a PowerShell script. But the user that has access to the instance is a domain user account different to the user logged on when running the script. So I developed a mechanism to invoke my SQL commands as a script block of a job because a job can be started with different credentials. You can find below my PowerShell script that connects to a…

Read More Read More

Dates and Time Zones in PowerShell

Dates and Time Zones in PowerShell

If you have already played with dates in PowerShell, you’ve probably realized that it was not so simple. If you are a beginner, I recommend you to read this article to get some basics about dates and times in PowerShell. On this article, we will focus on time zones, time offsets, and daylight-saving times. Actually, you can retrieve upcoming daylight saving time clock changes here. In this case, my computer time is based on UTC +01:00 (Central European Standard Time) timezone. Let’s make a…

Read More Read More