<#.SYNOPSIS This script creates then starts a process. .DESCRIPTION This script first creates a process object and populates the object. Then it uses the start method to actually start the process. This is an adaptation of the MSDN sample, but using a real executible as the targret process to create..NOTES File Name : start-process.ps1 Author : Thomas Lee -
Last modified by Thomas Lee on 2/9/2010 8:07:02 PM
<#.SYNOPSIS This script displays the printers on a given computer.DESCRIPTION This script first has to load system.printing, then it gets the printers (queues). NB: The queues are returned in a collection, not an array..NOTES File Name : Get-PrintQueue.ps1 Author : Thomas Lee - tfl@psp.co.uk Requires : PowerShell Version 2.0.LINK This script posted to: http://www.ps
Last modified by Thomas Lee on 1/11/2010 7:45:12 PM
<#.SYNOPSIS This script Creates then displays a GUID by using .TOString().DESCRIPTION This script demonstrates the 4 format specifiers you can send to .TOString() to affect the display. Note when you run this script, you will get a different GUID to the one shown in the example.NOTES File Name : Format-GUID.ps1 Author : Thomas Lee - tfl@psp.co.uk Requires : PowerShe
Last modified by Thomas Lee on 12/20/2009 12:58:40 PM
This is a quick example on how to use LoginMode with PowerShell.
[void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.SMO')function Get-LoginMode {param( [string]$SsdbName = $(throw 'SQL Server database instance name is missing as a parameter.') ) $Ssdb = New-Object 'Microsoft.SqlServer.Management.Smo.Server' $SsdbName $Ssdb.LoginMode}
An execution of the function w
Last modified by Thomas Lee on 12/5/2009 10:53:25 PM
To get a list of the Win32_* classes within Root/CIMV2 on your computer, you can use the following PowerShell Command:
Get-WMIObject -List| Where{$_.name -match "^Win32_"} | Sort Name | Format-Table Name
Last modified by ALBERTO DIAZ BERROGAIN on 1/2/2010 2:14:20 AM
<#.SYNOPSIS This script encrpyts then decrypts a byte string.DESCRIPTION This script uses System.Security to encrpyt a byte string, then decrypts it..NOTES File Name : Protect-ByteArray.ps1 Author : Thomas Lee - tfl@psp.co.uk Requires : PowerShell V2.LINK This script posted to: http://www.pshscripts.blogspot.com MSDN Sample posted at: http://msdn.microsoft.c
Last modified by Thomas Lee on 11/14/2009 1:54:50 PM
<#.SYNOPSIS This script displays the CA roles of the caller.DESCRIPTION This script instantiates the CA COM object, gets the allowed roles, and displays them. This script also shows use of Bitwise And operations, typical when using output from API calls..NOTES File Name : Get-CARolesofCaller.ps1 Author : Thomas Lee - tfl@psp.co.uk Requires : PowerShell V2.LINK T
Last modified by Thomas Lee on 10/24/2009 6:42:38 PM
# To access this interface in PowerShell - it is necessary to create a com object# The COM Object type is: CertificateAuthority.Admin.1# More detailed scripts will always show the com object creation, then# some use of what's created.# Create com object$CertAdmin = New-Object -com "CertificateAuthority.Admin.1"
Last modified by Vadims Podans on 11/3/2009 8:49:00 PM
# Create the com object$CertAdmin = New-Object -com "CertificateAuthority.Admin.1"# publish Base CRL only$CertAdmin.PublishCRLs("servername\caname", 0, 1)# publish Delta CRL only$CertAdmin.PublishCRLs("servername\caname", 0, 2)
Last modified by Vadims Podans on 11/3/2009 7:15:50 PM
# Create COM object$CertAdmin = New-Object -com "CertificateAuthority.Admin.1" # Revoke certificate with serial number 6ef5e9aa00000000008f# on CA with CAName that is hosted on computer named ServerName with# Superseded reason. Certificate will considered as revoked in 24 hours$CertAdmin.RevokeCertificate("ServerName\CAName","6ef5e9aa00000000008f",4, (Get-Date).AddDays(1))
Last modified by Thomas Lee on 10/24/2009 2:27:24 PM