#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){
  $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

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: