Note: This article is based on VMM 2008  and might not apply to VMM 2012 (R2)

Have you ever found yourself in a situation where you have a bunch of virtual machines (VMs) where the OWNER value is set to UNKNOWN and you wanted to set a value owner without having to modify them one VM at a time?  If so there’s a Windows PowerShell command that we can use to accomplish this:

Get-VM -VMMServer "vmm server FQDN" | where {$_.Owner -eq "Unknown"} | Set-VM -Owner "domain\account"

Presto, now your VMs have an owner as dictated by the account you used above.  So why might the owner even matter?  Well one instance where this is important is when you want to use the self-service portal to display all the VMs since to accomplish this the owner value need to be set to an account that is part of a Self-Service user role.

The VMs that show up in Self-Service are for Self-Service users only, not necessarily administrators, although an administrator can be part of a self-service user role.  However, he or she will only see the VMs that they own. If the user is not part of a Self Service user role, they will not be able to log into the web site.

There may be other reasons too but that’s the big one, and now if you ever find a need to do a mass change over the script above should hopefully save you a little time.

Note: This information was originally provided by Alvin Morales, Senior Support Engineer, on the System Center Virtual Machine Manager Team blog: