Trying to write a monitoring script for NLB Cluster status, which has 2 nodes.
I have 2 VMS (Win Srv 2016 Std): CB-1 and CB-2
When I run this command on these vms:
Get-NlbClusterNodeI get the output I need.
But if I try the same from a remote server (same network and domain) I get an:
Powershell
Accessisdenied.(ExceptionfromHRESULT:0x80070005(E_ACCESSDENIED))+CategoryInfo:+FullyQualifiedErrorId:AccessDenied,Microsoft.NetworkLoadBalancingClusters.PowerShell.GetNlbClusterNode
UAC already DISABLED
FIREWALL already DISABLED
WINRM already RUNNING
It's a clean installation in a demo server, so i can exclude any kind of systems problems
Why is that? It is ONLY the "Get-NlbClusterNODE" command that gives me access is denied. "Get-NlbCluster" for an example, works just fine.
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #$domainuser="dom\administrator"$domainpassword="xxxxxxx"|ConvertTo-SecureString-AsPlainText-Force$domaincredentials=New-ObjectSystem.Management.Automation.PSCredential($domainuser,$domainpassword)# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #Invoke-Command-ComputerNamecb-1.dom.local-Credential$domaincredentials-ScriptBlock{Get-NlbClusterNode-HostNamecb-1.dom.local}