Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $Computer = "abe.com"
- $Reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $computer)
- $RegKey=$Reg.OpenSubKey("SYSTEM\CurrentControlSet\services\NTDS\Parameters"
- $NTDSPath = $Regkey.GetValue("DSA Database file")
- $NTDSREMOTEPath = "\$computer$NTDSPath" -replace ":","$"
- $NTDSREMOTEPath = Get-item $NTDSREMOTEPath | Select-Object -ExpandProperty Length
- ($NTDSREMOTEPath /1GB).ToString("0.000"+" GB")
- Exception calling "OpenSubKey" with "1" argument(s): "Requested registry access is not allowed."
- At C:UsersDocumentsHealthCheckhardwareMonitoring.ps1:40 char:1
- + $RegKey= $Reg.OpenSubKey("SYSTEM\CurrentControlSet\services\NTDS\Parameters" ...
- + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
- + FullyQualifiedErrorId : SecurityException
- You cannot call a method on a null-valued expression.
- At C:UsersDocumentsHealthCheckhardwareMonitoring.ps1:41 char:1
- + $NTDSPath = $Regkey.GetValue("DSA Database file")
- + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- + CategoryInfo : InvalidOperation: (:) [], RuntimeException
- + FullyQualifiedErrorId : InvokeMethodOnNull
- Get-item : Cannot find path '\abc.com' because it does not exist.
- At C:UsersDocumentsHealthCheckhardwareMonitoring.ps1:43 char:19
- + $NTDSREMOTEPath = Get-item $NTDSREMOTEPath | Select-Object -ExpandProperty Lengt ...
- + ~~~~~~~~~~~~~~~~~~~~~~~~
- + CategoryInfo : ObjectNotFound: (\abc.com:String) [Get-Item], ItemNotFoundE
- xception
- + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemCommand
Add Comment
Please, Sign In to add comment