我正在尝试在新的故障转移群集设置中验证动态仲裁的功能。
PowerShell 中是否有命令可用于查看见证磁盘的当前投票?我一直在通过 TechNet 进行挖掘,但未能成功找到该命令(如果它首先存在的话)。
我有一个用于开发脚本的虚拟测试环境。由于 .NET 无法实现 PowerShell 提供的所有可能性,因此我使用远程 PowerShell 运行空间。
我现在的问题是,尽管该服务正在运行,但我无法访问 FileShare-Memberserver 上的 WinRM-Service。
初始情况:
winrm quickconfig 告诉我该服务正在所有各方上运行和配置。Test-wsman在 FileShare 本身上运行命令,那也不是问题。我在我的虚拟测试环境中快速绘制了服务器结构。(红色箭头表示该Test-WSMan命令无效)
我不知道如何继续解决这个问题。我在互联网上阅读了很多没有帮助的东西。我完成了TechNet 博客“about_Remote_Troubleshooting”的所有步骤。最重要的是,我的脚本可以访问同一台服务器上的 Exchange PS,这让我大吃一惊。几个月前我在SO上问了一个关于这个主题的问题,因为我认为我的脚本的 ShellUri 是错误的,尽管它适用于 DC 上的 PS。
因此,如果有人提示我接下来可以尝试什么,我将不胜感激。
I need help with a simple test case of executing a CLI command through PowerShell which has already been encoded in Base64.
Suppose Get-ChildItem has been converted in advance to Base64 string R2V0LUNoaWxkSXRlbQ==.
Further suppose I have a DOS CLI instance open, and I want to test executing this string in powershell:
C:>\ powershell.exe -enc R2V0LUNoaWxkSXRlbQ==
Run Code Online (Sandbox Code Playgroud)
However, I receive the following error:
The term '???????' is not recognized as the name of a cmdlet, function, script file, or operable …Run Code Online (Sandbox Code Playgroud) 我正在尝试执行以下 Powershell 命令:
Enter-PSSession -ComputerName localhost
Run Code Online (Sandbox Code Playgroud)
正在使用的服务器运行的是 Windows Server 2008 R2 SP1 64 位。服务器位于域中。我使用域管理员帐户登录。powershell 会话以管理员身份启动。
我从 powershell 本身收到以下错误消息:
PS C:\Users\Daniel> Enter-PSSession -Computername localhost
Enter-PSSession : Connecting to remote server localhost failed with the following error message : The client cannot
connect to the destination specified in the request. Verify that the service on the destination is running and is
accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most
commonly IIS or WinRM. If …Run Code Online (Sandbox Code Playgroud) 我实际上不需要在交换机上执行任何操作。我只需要验证它在那里。
我有一些远程服务器需要验证是否正确连接了蓝色串行控制台电缆。与其将 RDC 插入到每个文件中并复制/配置腻子只是为了几次回车,我想使用“enter-pssession”来远程连接到 PowerShell 并以这种方式访问 COM1。
我试过使用它,但在控制台上没有得到任何反馈。
https://blogs.msdn.microsoft.com/powershell/2006/08/31/writing-and-reading-info-from-serial-ports/
谢谢!
我在 Windows Server 2012 R2 Datacenter 上使用 WSUS 6.3 制作了一个更新服务器。我想使用 powershell 查看更新的状态(例如:KB3035583)。我知道有一些方法可以做到这一点,但我不知道其中任何一种。
使用 powershell(无 gui)如何找出我正在使用的适用于 Windows PowerShell 的 AWS 工具版本?
更多的:
我正在使用 powershell 远程处理和适用于 Windows PowerShell 的 AWS 工具从 S3 下载文件。我在设置凭据时遇到问题,这个 aws powershell 参考指出:
在早于 1.1 的 Windows PowerShell 工具版本中,Set-AWSCredentials 命令无法正常工作
但我不知道我使用的是哪个版本的 AWS 工具。似乎没有明显的命令可以尝试,例如,Read-S3Object 命令 -Version 参数用于确定正在下载的 S3 对象的版本,而不是 AWS 工具的版本。
我可能可以通过使用 RDP 和添加/删除程序 gui 来解决这个问题,但这是一个不同的问题,该服务器应该仅使用 powershell 远程处理进行管理。
我正在尝试重命名上周加入我们域的工作站。从那以后它至少重新启动过一次。
我的域基于 Windows 2012 R2,有问题的成员正在运行 Windows 10 专业版。如果这是有用的信息,我有三个 DC(是的,它们是同步的)。
重命名大部分时间都有效:
$aa = Get-Credential administrator@contoso.com
Rename-Computer -ComputerName mynewpc -NewName alpc001 -DomainCredential $aa
WARNING: The changes will take effect after you restart the computer mynewpc.
Run Code Online (Sandbox Code Playgroud)
但是我有几台机器顽固地拒绝重命名:
Rename-Computer -ComputerName otherhp -NewName alpc005 -DomainCredential $aa
Rename-Computer : Fail to rename computer 'otherhp' to 'alpc005' due to the following exception: Cannot create a file when that file already exists.
At line:1 char:1
+ Rename-Computer -ComputerName otherhp -NewName alpc005 -DomainCredent ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : …Run Code Online (Sandbox Code Playgroud) 在 Register-ClusteredScheduledTask 下面执行时,我收到此错误。
Register-ClusteredScheduledTask -TaskName $ClusterTaskName -TaskType AnyNode -Xml $TaskXML | 出空
Register-ClusteredScheduledTask : The parameter is incorrect.
At C:\Setup-Scheduler.ps1:215 char:5
+ Register-ClusteredScheduledTask -TaskName $ClusterTaskName -TaskT ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo: InvalidArgument: (PS_ClusteredScheduledTask:Root/Microsoft/...ed
ScheduledTask) [Register-ClusteredScheduledTask], CimException
+ FullyQualifiedErrorId: HRESULT 0x80070057,Register-ClusteredScheduledTask
Run Code Online (Sandbox Code Playgroud)
我的 XML
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo />
<Triggers>
<TimeTrigger>
<Repetition>
<Interval>PT15M</Interval>
<StopAtDurationEnd>false</StopAtDurationEnd>
</Repetition>
<StartBoundary>2016-11-08T13:26:00</StartBoundary>
<Enabled>true</Enabled>
</TimeTrigger>
<TimeTrigger>
<Repetition>
<Interval>PT5H</Interval>
<StopAtDurationEnd>false</StopAtDurationEnd>
</Repetition>
<StartBoundary>2016-11-09T19:29:00</StartBoundary>
<Enabled>true</Enabled>
</TimeTrigger>
<CalendarTrigger>
<StartBoundary>2016-11-09T19:29:00</StartBoundary>
<Enabled>true</Enabled>
<ScheduleByDay>
<DaysInterval>1</DaysInterval>
</ScheduleByDay>
</CalendarTrigger>
<CalendarTrigger>
<StartBoundary>2016-11-09T00:00:00</StartBoundary>
<Enabled>true</Enabled>
<ScheduleByMonth>
<DaysOfMonth>
<Day>9</Day> …Run Code Online (Sandbox Code Playgroud) 我正在创建一个在远程服务器上使用多个“Invoke-Command -asjob”的脚本,但在测试 While-Loop 时我不得不停止它。但是,当我现在在目标服务器上尝试 Invoke-Command -asjob 时,它返回状态为 failed 的作业。当我收到作业时,它返回此错误:
The WS-Management service cannot process the request. This user has exceeded the maximum number of concurrent shells allowed for this plugin. Close at least one open shell or raise the plugin quota for this user.
+ FullyQualifiedErrorId : -2144108060,PSSessionStateBroken
Run Code Online (Sandbox Code Playgroud)
当我执行 Get-PSSession 时,没有列出,所以我不能使用 Remove-PSSession(这是 Google 迄今为止唯一的建议)。
这是它基本上执行的内容:
While ($True)
{
Invoke-Command -Computername $RemoteServer -AsJob {Get-ChildItem}
}
Run Code Online (Sandbox Code Playgroud)
我打破了它并做了Get-Job | Remove-Job 删除了所有作业,但我仍然无法在远程服务器上启动 Invoke-Command -AsJob。
我还在远程服务器上重新启动了 WSMAN 服务(通过使用 RDP 登录),但它不起作用。