The “Hey, Scripting Guys!” blog has been retired. There are many useful posts in this blog, so we keep the blog here for historical reference. However, some information might be very outdated and many of the links might not work anymore.
New PowerShell content is being posted to the PowerShell Community blog where members of the community can create posts by submitting content in the GitHub repository.
Scripting Blog [archived]
Formerly known as the "Hey, Scripting Guy!" blog
Latest posts
PowerTip: Use PowerShell to dismount a disk image
Summary: Learn how to use Windows PowerShell to dismount a virtual disk or ISO. How can I use Windows PowerShell to dismount a virtual disk? Use the Dismount-DiskImage cmdlet. It will dismount either an ISO or a virtual hard disk. Specify the path then using -imagepath. Here is an example: Dismount-DiskImage -imagepath “C:\fso\myisodisk.iso”
PowerTip: Use PowerShell to disconnect virtual disk
Summary: Learn how to use Windows PowerShell to disconnect from a virtual disk. How can I use Windows PowerShell to disconnect from a virtual disk? Use the Disconnect-VirtualDisk cmdlet and specify the friendly name, for example: Disconnect-VirtualDisk -FriendlyName VirtualDisk01
PowerTip: Disconnect sessions to ISCSI target with PowerShell
Summary: Learn how to disconnect sessions to a specified ISCSI target with Windows PowerShell. How can I use Windows PowerShell to disconnect sessions to a ISCSI target object? Use the Get-ISCSITarget cmdlet to retrieve the target, and then supply it as a node address for Disconnect-ISCSITarget, for example: Get-IscsiTarget $Tar = Get-IscsiTarget Disconnect-IscsiTarget -NodeAddress $Tar.NodeAddress
PowerTip: Enable and disable ODBC performance counter settings with PowerShell
Summary: Learn how to enable and disable a collection of ODBC performance counter settings for troubleshooting. How can I use Windows PowerShell to enable the ODBC performance counters, run commands in a script, and then disable the counters? You can store a returned object for later use when you enable the performance counters by using the -PassThru parameter, for example: $perfCounter = Enable-OdbcPerfCounter -Platform 32-bit -PassThru <Execute some ODBC applications that are using ODBC pooling> Disable-OdbcPerfCounter $perfCounter
PowerTip: Enable PerfMon counters for ODBC connection pooling with PowerShell
Summary: Learn how to use Windows PowerShell to enable Windows Performance Monitor counters for ODBC connection pooling. How can I use Windows PowerShell to enable Windows Performance Monitor (PerfMon) counters so I can troubleshoot Open Database Connectivity (ODBC) connection pooling? Use the Enable-ODBCPerfCountger cmdlet and specify the platform (32 bit or all). Here is an example: Enable-OdbcPerfCounter -Platform 32-bit
PowerTip: Use PowerShell to disable constrained delegation
Summary: Learn how to use Windows PowerShell to disable constrained delegation. How can I use Windows PowerShell to disable constrained delegation authorization so that a user who is remotely connected to a SMB server cannot configure resources? Use the Disable-SmbDelegation cmdlet, and specify the client and the SMB server, for example: Disable-SmbDelegation –SmbServer "FileServer01" –SmbClient "HVSVR01"
PowerTip: Use PowerShell to disable all scheduled tasks in folder
Summary: Use Windows PowerShell to disable all scheduled tasks in a specific folder. How can I use Windows PowerShell to disable all scheduled tasks in a particular folder? Use the Get-ScheduledTask cmdlet to enumerate the scheduled tasks in the folder, and then pipe the objects to the Disable-ScheduledTask cmdlet, for example: Get-ScheduledTask -TaskPath "\UpdateTasks\" | Disable-ScheduledTask
PowerTip: Use PowerShell to disable scheduled task
Summary: Learn how to use Windows PowerShell to disable a scheduled task. How can I use Windows PowerShell to disable a scheduled task? Use the Disable-ScheduledTask cmdlet and specify the task name, for example: Disable-ScheduledTask -TaskName "SystemScan"
PowerTip: Disable plug and play device with PowerShell
Summary: Learn how to disable a plug and play device with Windows PowerShell. How can I use Windows PowerShell to disable a plug and play device? Use the Disable-PNPDevice cmdlet and specify the instance ID, for example: Disable-PnpDevice -InstanceID 'USB\VID_5986&;PID_0266&;MI_00\7&;1E5D3568&;0000'