Hi
I'm making use of the AddNewStandAloneVM.ps1 Microsoft made available. I need this script to add certain virtual machines to certain Protection Groups. Example: AAA-WIN01, should be added to PG-VPS-WIN
So I need to be able to specify the name within the script (*WIN*) then the script should only add the datasources that matches this name.
So far, I've been using an exclusion list, but it's a hassle to include loads of exlusions. To let the script match it would mean a cleaner script.
Here's the part I've changed from AddNewStandAloneVM.ps1:
# 7. If object is a data source and of type Hyper-V and is currently not protected add to list of unprotected VMs$unprotectedDsList = @($DSlist | ? {$($_.Type.IsDatasource) -and ($($_.Type.Id) -match $guid)`
-and ($($_.Name) -notlike "Backup Using Saved State\*NIX*")`
-and ($($_.Name) -notlike "Backup Using Child Partition\*NIX*")`
Above should basically exlude any servername with 'NIX' in the name.
Some help would be appreciated!
Thanks.