Hello,
because a update killed our vcetner vmware suggested we build a new one.
I have already importet the roles + permission to that role
how can I Export and Import the permission of a of all roles on all objects e.g datacenters and folders.
will be nice if there is an easy way.
by tutti
That depends what you have in the Propagate column in the CSV.
You could try with
Propagate = [Boolean]$row.Propagate
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Have a look at Solved: Export Roles Permissions Privileges - Export-Excel... - VMware Technology Network VMTN
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
powershell cant recognize export-excel
seem like I cant do it with Excel Export is it possible to do it with Standard thinks where I dont Need to download Moduls
Sure, you can use Export-Csv to two separate CSV files.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
ok now I have to files how do I Import this to the new vcenter?
The import part is also in that thread
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
but I have now 2 files and not 1 csv, can I just do 1 file and then run again with the other?
I did run them and I get "new-VIPermission: System.String cant convert to System Boolean"
is it because the csv dont have worksheet names?
You can have 2 different types of objects in the same CSV.
So it is either 2 CSV files or work with the Worksheets
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I get this
New-VIPermission : "System.String" can not be converted to "System.Boolean", for the Parameter "Propagate" is needed.
In Z:\Vmware\script\import vcenter.ps1:12 Zeichen:22
+ New-Vipermission @Sperm
+ ~~~~~~
+ CategoryInfo : InvalidArgument: (:) [New-VIPermission], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgument,VMware.VimAutomation.ViCore.Cmdlets.Commands.PermissionManagement.NewVIPermission
That depends what you have in the Propagate column in the CSV.
You could try with
Propagate = [Boolean]$row.Propagate
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Ok thanks that worked and because I already had the roles in there I only need 1 csv
Hello Lucd it seems not all permissions where set I got some lines with
New-VIPermission : the argumentiontransformation for the parameter "Entity" could not be processed. This parameter no longer accepts an array. As an
alternative you may pass multiple values by pipeline (if supported by the parameter).
That could mean that you have entities (VM, Folders...) with the same name in the target vCenter.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
yeah in the Import file I have 10 with the exact same lines with "UserXXX","admin","true","Test"","Folder"
so the script doesn't knwo the exact location of the folders.Can you help me to change this or is that not possible?
Yes, that is possible when you use the full path in the export.
As I mentioned in Export / Import folder permissions - VMware Technology Network VMTN you can combine the export with the Get-FolderPath function.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I only get VIobject is empty on the Folder script. I not really good with powershell can you help me merge the Folder and permission script to the Import and Export script?
You could give this one a try: Copy Folders Permissions and Roles from vCenter - Bluewire
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
ok so I get a error that I have multible Datacenter in the vcenter but I only named one under "datacenter"
then in the import script it tells me something with switches what I dont know what to do
Is that with that script I pointed to?
Which errors exactly?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
yeah in the script first 2 line it says no multible datacenter and it seems that it will still to all datacenter but cant keep up with it
on the import script I need to use -permissions yeah guess what I need to state the datacenter too now too and then it did merge our 4 datacenter is this one and rearanged the folder but I only did the -permissions and not -folder
so I gues I will do the handjob now move it back and make the permission that are missing too.
still thanks for you help