Close

PowerShell

PowerShell – nslookup

If you want to check if machines fqdn is mapped to a ip address in dns, then on a windows machine you do: start->enter “nslookup” then type domain name, and hit enter, e.g.: You should get an output like this: > google.com Non-authoritative answer: Name: google.com Addresses: 2a00:1450:4009:800::200e 216.58.210.46 >

Read More

PowerShell – Active Directory

Active Directory is a type of LDAP. You can query active directory using set of powershell commands. To do this you need to first turn on the AD windows feature. You do this on windows like this: start -> control panel -> programs -> Program and Features -> Turn windows […]

Read More

Powershell – Make a permanent change to the “path” environment variable

A common task you often need to do is append a new path to the path environment variable: $ENV:PATH The first way is simply to do: $ENV:PATH=”$ENV:PATH;c:\path\to\folder” But this change isn’t permenantly, $env:path will default back to what it was before as soon as you close your powershell terminal and […]

Read More

PowerShell – Working with providers

Chapter 5 – Working with providers WordPress has things called plugins, which can extend wordpress’s features. Powershell has similar features which are called snapins and modules. In PS, we have things called “PSDrives”. These are a bit like virtual hard drives (vhdds). Some of these virtual hdds stores a normal […]

Read More

PowerShell – IIS automation

You can view the IIS gui conole by running “Inetmgr” on the commandline.     To automate IIS you first need to ensure you have the “webadministration”:   [powershell] PS C:\Windows\system32> Get-Module -ListAvailable Directory: C:\Windows\system32\WindowsPowerShell\v1.0\Modules ModuleType Version Name ExportedCommands ———- ——- —- —————- Manifest 1.0.0.0 ADRMS {Update-ADRMS, Uninstall-ADRMS, Install-ADRMS} Manifest […]

Read More

PowerShell – Detect what version of .NET is installed

http://stackoverflow.com/questions/199080/how-to-detect-what-net-framework-versions-and-service-packs-are-installed   The tale given in the first answer in the above stackoverflow questions shows what to look for. Then do:   [powershell] cd HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP ls [/powershell] This should give output that looks like: cd HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP ls SKC VC Name Property — — —- ——– 1 […]

Read More

Powershell – Accessing the registry

There are 2 main cmdlets you use to identify and navigate the registry (instead of using regedit). First of you navigate the registry in the same style as navigating a folder structure, i.e. you navigate it using cd and get-childitem. But the registry doesn’t reside inside the c:\ drive, instead […]

Read More