Scripting Blog [archived]

Formerly known as the "Hey, Scripting Guy!" blog

Latest posts

Mar 12, 2016
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to dismount a disk image

Doctor Scripto

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”

Feb 28, 2016
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to disconnect virtual disk

Doctor Scripto

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

Feb 28, 2016
Post comments count 0
Post likes count 0

PowerTip: Disconnect sessions to ISCSI target with PowerShell

Doctor Scripto

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

Feb 27, 2016
Post comments count 0
Post likes count 0

PowerTip: Enable and disable ODBC performance counter settings with PowerShell

Doctor Scripto

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

Feb 27, 2016
Post comments count 0
Post likes count 0

PowerTip: Enable PerfMon counters for ODBC connection pooling with PowerShell

Doctor Scripto

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

Feb 26, 2016
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to disable constrained delegation

Doctor Scripto

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"  

Feb 26, 2016
Post comments count 0
Post likes count 1

PowerTip: Use PowerShell to disable all scheduled tasks in folder

Doctor Scripto

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

Feb 25, 2016
Post comments count 0
Post likes count 1

PowerTip: Use PowerShell to disable scheduled task

Doctor Scripto

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"

Feb 25, 2016
Post comments count 0
Post likes count 0

PowerTip: Disable plug and play device with PowerShell

Doctor Scripto

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'