Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Tuesday, July 8, 2014 9:04 PM
Hello,
I need to create a Windows Failover cluster using Power Shell. The script that runs initially is run as a admin user AND not a domain user.
During the script I would like the command to run and create a new cluster e.g.
'New-Cluster -Name WINCLUSTER2 -Node AlWAYSON1 –StaticAddress xx.xx.xx.xx'
as a domain administrator which does not require a prompt or a new powershell window to open.
Can some please provide me with the syntax for this ? I tried using remoting using the Invoke command but this did not allow cluster commands to be run.
Thanks
All replies (3)
Thursday, July 10, 2014 2:22 AM ✅Answered
Hi Osullp3,
Sorry for I haven no availbale cluster enviroment, based on the error, we need to create powershell remoting via CredSSP when run the cmdlet "New-Cluster" remotely.
On the local machine that will issue the commands, run:
Enable-WSManCredSSP Client -DelegateComputer <remote server name> -Force
On the remote server that will receive the commands, run:
Enable-WSManCredSSP Server
Then when running the remote commands, use the following:
$CustomCred = Get-Credential #Stores a credential to use and you will be prompted on screen
Invoke-Command -ComputerName <destination computer> -ScriptBlock {remote stuff} -Authentication Credssp -Credential $CustomCred
For more detailed information, please check this article:
PowerShell Remoting and the “Double-Hop” Problem
Best Regards,
Anna Wang
Wednesday, July 9, 2014 9:58 AM
Hi Osullp3,
To run the cmdlet "New-Cluster" remotely with domain admin, please try the script below and feedback:
Invoke-Command -ComputerName remotecomputername -ScriptBlock {import-module failoverclusters;Test-cluster -Node testnode1.testdomain.com;New-Cluster -Name testcluster1 -Node testnode1.testdomain.com -StaticAddress 192.168.1.10}
If you get any error information, please post the error and the code to help us to troubleshoot.
Best Regards,
Anna Wang
Wednesday, July 9, 2014 5:03 PM
Hi Anna,
I tried that command and it didn't work. Got the error below.
What I want to do is while logged in as a local admin during a script on the same shell and without a prompt change to a domain administrator and create the cluster. Would you know how I can do this ?
WARNING: If you are running Windows PowerShell remotely, note that some failover clustering cmdlets do not work
remotely. When possible, run the cmdlet locally and specify a remote computer as the target. To run the cmdlet
remotely, try using the Credential Security Service Provider (CredSSP). All additional errors or warnings from thi
cmdlet might be caused by running it remotely.