Any idea how I can relatemy Get-Snapshot information to the Get-VIEvent information to work out who created a snapshot ?
Thanks
Alan
Ok, in the following replace my accountname with yours (only the account, not the domain).
Then check if the mail address is returned.
$usr = 'lucd'
$root = [ADSI]""
$filter = ("(&(objectCategory=user)(samAccountName=$Usr))")
$ds = New-Object system.DirectoryServices.DirectorySearcher($root,$filter)
$ds.PageSize = 1000
$info = $ds.FindOne()
$info | Select @{N='User';E={$_.Properties.name}},@{N='Mail';E={$_.Properties.mail}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
It looks like you're referencing lines 12-17. Do I also need to add this line?
$info | Select @{N='User';E={$_.Properties.name}},@{N='Mail';E={$_.Properties.mail}}
And then replace line 17 with this line?
$info = $ds.FindOne()
Edit: After running it with just changing the username name I still have a empty value in the mailto variable.
No, no, this is a stand-alone script to check if your email address is returned correctly from the AD search
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
That script returned "Exception calling "FindOne" with "0" argument(s): "The specified domain either does not exist or could not be contacted."
Does this return your AD domain?
([ADSI]"").distinguishedName
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
It ran but did not return anything.
Did you logon to an AD domain?
Or are you working form a stand-alone station?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I logon to an AD domain.
Does this make a difference?
$usr = 'lucd'
$filter = ("(&(objectCategory=user)(samAccountName=$Usr))")
$ds = New-Object system.DirectoryServices.DirectorySearcher($filter)
$ds.PageSize = 1000
$info = $ds.FindOne()
$info | Select @{N='User';E={$_.Properties.name}},@{N='Mail';E={$_.Properties.mail}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I get the same error as before.
I'm afraid I'm at my wit's end for now.
The issue with the missing email is obviously due to the fact that the email address can't be obtained from AD.
Not sure why right now.
Do your AD admins perhaps have some code that is able to retrieve user info from AD
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I really appreciate your time spent helping me. I can ask to see if that would be possible to do. I'll update if I can get it working.
LucD is it possible using this to look for snapshot creator that was 2-3 months back?
Depends how long Task and Events are kept in your vCenter.
The default is 1 year, in that case, yes, you should be able to find the creator.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
LudD, is there any where to tweak this?
i found out my environment might be holding shorter timespan as i could not get a creator of snapshot although the script able to list any VMs which has snapshot.
I'm afraid not, afaik.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
the thing it is able to get the vm snapshot creation details except creator makes me wonder, why.
if you found anywhere, please give a shout
thanks