Datasheet

24 CHAPTER 1
AUTOMATING VCENTER SERVER DEPLOYMENT AND CONFIGURATION
$report | export-csv $Filename -NoTypeInformation
}
}
Export-PermissionsToCSV -Filename “C:\Temp\Permissions.csv”
Importing Permissions
It is equally important to be able to import the permissions back into your vCenter
Server. You can use the script in Listing 1.7.
LISTING 1.7
Importing permissions
function Import-Permissions {
<#
.SYNOPSIS
Imports all Permissions from CSV file
.DESCRIPTION
The function will import all permissions from a CSV
file and apply them to the vCenter Server objects.
.NOTES
Source: Automating vSphere Administration
Authors: Luc Dekens, Arnim van Lieshout, Jonathan Medd,
Alan Renouf, Glenn Sizemore
.PARAMETER DC
The Datacenter to import the permissions into
.PARAMETER Filename
The path of the CSV file to be imported
.EXAMPLE 1
PS> Import-Permissions -DC “DC01” `
-Filename “C:\Temp\Permissions.csv”
#>
param(
[String]$DC,
[String]$Filename
)
process {
890790c01.indd 24890790c01.indd 24 3/3/11 10:22:16 AM3/3/11 10:22:16 AM