Имя пользователя:
Пароль:
 

Показать сообщение отдельно

Старожил


Сообщения: 254
Благодарности: 41

Профиль | Отправить PM | Цитировать


Тогда я что-то не понимаю. Запускаю Ваш скрипт, получаю:
Скрытый текст

PS C:\Users\adm\Documents> C:\Users\adm\Documents\test1.ps1
Connect to 172.168.55.8


ErrorCode : -2147023174
Message : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
Data : {}
InnerException :
TargetSite : Void Start()
StackTrace : at System.Management.ThreadDispatch.Start()
at System.Management.ManagementScope.Initialize()
at System.Management.ManagementObjectSearcher.Initialize()
at System.Management.ManagementObjectSearcher.Get()
at Microsoft.PowerShell.Commands.GetWmiObjectCommand.BeginProcessing()
HelpLink :
Source : System.Management
HResult : -2147023174



Connect to 172.168.55.9


ErrorCode : -2147023174
Message : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
Data : {}
InnerException :
TargetSite : Void Start()
StackTrace : at System.Management.ThreadDispatch.Start()
at System.Management.ManagementScope.Initialize()
at System.Management.ManagementObjectSearcher.Initialize()
at System.Management.ManagementObjectSearcher.Get()
at Microsoft.PowerShell.Commands.GetWmiObjectCommand.BeginProcessing()
HelpLink :
Source : System.Management
HResult : -2147023174


По данным IP компьютеры включены и доступны, если выполнить обращение вручную.

Debug:
Скрытый текст

Connect to 172.168.55.8
DEBUG: 5+ >>>> Trace-Command {Get-WmiObject -Class Win32_OperatingSystem -Namespace root/cimv2
-ComputerName $IP} -PSHost -Name ParameterBinding
DEBUG: 5+ Trace-Command >>>> {Get-WmiObject -Class Win32_OperatingSystem -Namespace root/cimv2
-ComputerName $IP} -PSHost -Name ParameterBinding
DEBUG: 5+ Trace-Command { >>>> Get-WmiObject -Class Win32_OperatingSystem -Namespace root/cimv2
-ComputerName $IP} -PSHost -Name ParameterBinding
DEBUG: ParameterBinding Information: 0 : BIND NAMED cmd line args [Get-WmiObject]
DEBUG: ParameterBinding Information: 0 : BIND arg [Win32_OperatingSystem] to parameter [Class]
DEBUG: ParameterBinding Information: 0 : COERCE arg to [System.String]
DEBUG: ParameterBinding Information: 0 : Parameter and arg types the same, no coercion is needed.
DEBUG: ParameterBinding Information: 0 : BIND arg [Win32_OperatingSystem] to param [Class] SUCCESSFUL
DEBUG: ParameterBinding Information: 0 : BIND arg [root/cimv2] to parameter [Namespace]
DEBUG: ParameterBinding Information: 0 : COERCE arg to [System.String]
DEBUG: ParameterBinding Information: 0 : Parameter and arg types the same, no coercion is needed.
DEBUG: ParameterBinding Information: 0 : BIND arg [root/cimv2] to param [Namespace] SUCCESSFUL
DEBUG: ParameterBinding Information: 0 : BIND arg [172.168.55.8] to parameter [ComputerName]
DEBUG: ParameterBinding Information: 0 : COERCE arg to [System.String[]]
DEBUG: ParameterBinding Information: 0 : Trying to convert argument value from System.String to
System.String[]
DEBUG: ParameterBinding Information: 0 : ENCODING arg into collection
DEBUG: ParameterBinding Information: 0 : Binding collection parameter ComputerName: argument type [String],
parameter type [System.String[]], collection type Array, element type [System.String], coerceElementType
DEBUG: ParameterBinding Information: 0 : Creating array with element type [System.String] and 1 elements
DEBUG: ParameterBinding Information: 0 : Argument type String is not IList, treating this as scalar
DEBUG: ParameterBinding Information: 0 : COERCE arg to [System.String]
DEBUG: ParameterBinding Information: 0 : Parameter and arg types the same, no coercion is needed.
DEBUG: ParameterBinding Information: 0 : Adding scalar element of type String to array position 0
DEBUG: ParameterBinding Information: 0 : Executing VALIDATION metadata:
[System.Management.Automation.ValidateNotNullOrEmptyAttribute]
DEBUG: ParameterBinding Information: 0 : BIND arg [System.String[]] to param [ComputerName] SUCCESSFUL
DEBUG: ParameterBinding Information: 0 : BIND POSITIONAL cmd line args [Get-WmiObject]
DEBUG: ParameterBinding Information: 0 : MANDATORY PARAMETER CHECK on cmdlet [Get-WmiObject]
DEBUG: ParameterBinding Information: 0 : CALLING BeginProcessing
DEBUG: ParameterBinding Information: 0 : BIND PIPELINE object to parameters: [Out-Default]
DEBUG: ParameterBinding Information: 0 : PIPELINE object TYPE = [System.Management.Automation.ErrorRecord]
DEBUG: ParameterBinding Information: 0 : RESTORING pipeline parameter's original values
DEBUG: ParameterBinding Information: 0 : Parameter [InputObject] PIPELINE INPUT ValueFromPipeline NO COERCION
DEBUG: ParameterBinding Information: 0 : BIND arg [The RPC server is unavailable. (Exception from HRESULT:
0x800706BA)] to parameter [InputObject]

DEBUG: ParameterBinding Information: 0 : BIND arg [The RPC server is unavailable. (Exception from HRESULT:
0x800706BA)] to param [InputObject] SUCCESSFUL

-------
MCSA -> MCSE


Последний раз редактировалось MaleyDarc, 19-04-2017 в 14:59.


Отправлено: 14:50, 19-04-2017 | #3