To get the password for each and every managed account in the farm, just run this PowerShell script by Shannon Bray in an elevated SharePoint Management Shell:
You can also obtain the password of any web application pool by running this in an elevated command shell:
function Bindings() { return [System.Reflection.BindingFlags]::CreateInstance -bor [System.Reflection.BindingFlags]::GetField -bor [System.Reflection.BindingFlags]::Instance -bor [System.Reflection.BindingFlags]::NonPublic } function GetFieldValue([object]$o, [string]$fieldName) { $bindings = Bindings return $o.GetType().GetField($fieldName, $bindings).GetValue($o); } function ConvertTo-UnsecureString([System.Security.SecureString]$string) { $intptr = [System.IntPtr]::Zero $unmanagedString = [System.Runtime.InteropServices.Marshal]::SecureStringToGlobalAllocUnicode($string) $unsecureString = [System.Runtime.InteropServices.Marshal]::PtrToStringUni($unmanagedString) [System.Runtime.InteropServices.Marshal]::ZeroFreeGlobalAllocUnicode($unmanagedString) return $unsecureString } Get-SPManagedAccount | select UserName, @{Name=”Password”; Expression={ConvertTo-UnsecureString (GetFieldValue $_ “m_Password”).SecureStringValue}}
You can also obtain the password of any web application pool by running this in an elevated command shell:
C:\Windows\System32\inetsrv\appcmd list apppool "[App Pool Name]" /text:*
No comments:
Post a Comment