#Powershell and NSPI

So been having some fun with #BlackBerry and DCs only having the default NSPI setting of 50.

Wrote this to dump the NSPI registry key for all DCs

$currentdom = [System.DirectoryServices.ActiveDirectory.Domain]::getcurrentdomain()
$DCs = @(); $currentdom.DomainControllers | Sort Name | ForEach{$DCs += $_.name}
ForEach($item in $DCs){
  $nspi=0
  $srv = $item
  Write-Host $srv –NoNewLine
  $reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey(‘LocalMachine’, $srv)
  $regKey= $reg.OpenSubKey(“SYSTEM\\CurrentControlSet\\Services\\NTDS\\Parameters” )
  $nspi = $regkey.GetValue(“NSPI max sessions per user”)
  Write-Host “`tNSPI max sessions per user: ” $nspi
}

#Exchange 2010 Invalid Objects

#Exchange2010 #Powershell

So I have been having some with these.  I currently have a whole load of groups, mailboxes and contracts are okay in Exchange 2003, but 2010 doesn’t like them.

If you have one you can use this cmdlet to findout what is wrong

(Get-Mailbox <user>).Validate()

Shweet

#Powershell and Select

Just wanted to share this with you.  Was playing with PowerShell the other day, like you do and discovered this.

Say you run Get-Process and you use the select option to choose the heading:

PS C:\PS> Get-Process zune* | select ProcessName, id

ProcessName                                                                                                          Id
———–                                                                                                          —
ZuneLauncher                                                                                                       2412

Did you know you can use an array in the select command? Neither did I!

PS C:\PS> $x=”ProcessName”,”id”
PS C:\PS> Get-Process zune* | select $x

ProcessName                                                                                                          Id
———–                                                                                                          —
ZuneLauncher                                                                                                       2412

How kewl is that?!