Quantcast
Viewing all articles
Browse latest Browse all 20396

Powershell Authentication Help Post Server 2012 R2 Upgrade

Hello,

 

We've recently upgraded our VMWare vCenter server from 2008 R2 to 2012 R2 and upgraded vCenter from 5.0.0 to 5.5.0.  Since then our SAM PS script that checks for snapshots (below) is failing with permissions.

 

Add-PSSnapin -Name VMware.VimAutomation.Core

#If you get an out of memory error on the vCenter Server run "set-item wsman:localhost\Shell\MaxMemoryPerShellMB 768"

function Get-Snaps{

    $vms = get-vm | where {$_.Name -ne "SERVER1"} | sort name

    $vmsnaps = @()

    $i=0

    $Age = 7

    foreach($vm in $vms){

    $snap = Get-Snapshot $vm

    if($snap){

           $vmsnaps += $vm

     #write-host -fore green `n `t $vm

     $snapshots = Get-Snapshot $vm

     foreach ($snapshot in $snapshots){

               

                if ( $snapshot.Created -lt (Get-Date).AddDays( -$Age ) ) {

        $FSnapshots = $FSnapshots + "" + $vm + "</br>"

                    $i=$i+1

                }

               

            }

    }

    }

write-host "Message:"$FSnapshots

write-host "Statistic:"$i

}

Connect-VIServer ${ip} -WarningAction 0

Get-Snaps

Disconnect-VIServer -Force:$true -Confirm:$false

 

I've tried connecting on my vCenter server using the "Connect-VIServer <FQDN>" but its prompting for credentials which it didnt normally do, I guess it used integrated / pass through credentials.

 

Anyone any ideas how I can fix this?

 

Thanks,

Peter

Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 20396

Trending Articles