Hi ,
I am trying to create lots of folders of type 'Datacenter' and their corresponding permissions under a newly built vCenter.
All the inputs are fed from csv.
I want to know the working syntax of New-Folder and New-VIPermission for the same-
#Values like $folder,$vCenter,$fRole, $Principal and are fed from csv through a loop
#loop begins
#create folders of type datacenter under vCenter
New-Folder -Name $folder -Server $vCenter ( How could I create a folder of type datacenter, get-folder has a type parameter but i saw new-folder doesnt have one )
#create permissions for those folders
New-VIPermission -Role $fRole -Principal $Principal -Entity $folder
#loop ends
Sure
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
A folder under a datacenter does not offer the type Datacenter. Only under the vCenter can you have a folder of type Datacenter.
You can only have VM, HostandCLuster, Network and Datastore under a datacenter.
The New-Folder does indeed not yet offer the Type parameter, but you can use the hidden folders.
For example, if you want to create folders of type VM under a datacenter, you can do
Get-Folder -Name vm -Server $vCenter |
New-Folder -Name $folder -Server $vCenter
New-VIPermission -Role $fRole -Principal $Principal -Entity $newFolder
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks - I could understand that i cannot create a folder of type datacenter under an existing datacenter.
But I am trying to create Folder of type ' Datacenter ' under vCenter - do we have a cmdlet for it.
Sure
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks. Thats perfect !