Microsoft Virtualization Discussions
Microsoft Virtualization Discussions
We are intending to use the PS OnTAP module for provisioning users on our N-Series filers, some 45,000 of them . So far, so good but we have hit a bit of a snag. We need to be able to do a 'cifs homedir load' after adding a batch of users so that OnTAP will present their Home Drive shares for them. We can't seem to find anything in the PS functions that will do this for us. There isn't even a catch all 'ExecCLI' function which would have been a way around it. The only thing we can think of, so far, is to have the PS script do an ssh to the filer and run the command but would prefer not to do it that way if possible.
Any suggestions welcome.
Solved! See The Solution
In the Data ONTAP PowerShell toolkit 1.1, create an array of strings, on for each home directory path. Then use set-nacifshomedirectory to load the array. This is analogous to manually editing cifs_homdir.cfg and then executing "cifs homedir load" from the console. If you want to add a batch of home directories to an existing list, then you'll want to get-nacifshomedirectory, dump the results to an array, append your new user home directories, then use set-nacifshomedirectory.
NAME
Set-NaCifsHomeDirectory
SYNOPSIS
Provides a list of CIFS home directory paths for the controller.
SYNTAX
Set-NaCifsHomeDirectory [-Paths] <String[]> [-Force] [-Controller <NaControl
ler>] [-WarningAction <ActionPreference>] [-WarningVariable <String>] [<Comm
onParameters>]
DESCRIPTION
Provides a list of CIFS home directory paths for the controller. Replaces th
e current list of paths in use by the controller. Note that supplying an emp
ty path list causes controller to delete any current entries.
PARAMETERS
-Paths <String[]>
An array, one entry per each CIFS home directory path.
Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-Force
If true, the new set of homedir paths will be put into use even if some
user homedir connections will be broken. This can cause users with open
files in their home directories to lose access to the files. A user can
lose data if there are updates not yet committed to disk.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Controller <NaController>
The DataONTAP controller object, embodied by an NaController object. Th
is parameter is returned by the Connect-NaController cmdlet. If not spe
cified, the value in the global variable CurrentNaController is used.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-WarningAction <ActionPreference>
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-WarningVariable <String>
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".
INPUTS
OUTPUTS
NetApp.Ontapi.Filer.Cifs.PathErrorInfo
NOTES
Category: cifs
API: cifs-homedir-paths-set
-------------- Example 1 --------------
C:\PS>Set-NaCifsHomeDirectory "/vol/vol0/user1","/vol/vol0/user2","/vol/vol0
/user3"
Set the home directories for three users (one of which doesn't exist).
ErrorPath ErrorPathDesc
--------- -------------
/vol/vol0/user3 Homedir path doesn't exist, discardi
...
In the Data ONTAP PowerShell toolkit 1.1, create an array of strings, on for each home directory path. Then use set-nacifshomedirectory to load the array. This is analogous to manually editing cifs_homdir.cfg and then executing "cifs homedir load" from the console. If you want to add a batch of home directories to an existing list, then you'll want to get-nacifshomedirectory, dump the results to an array, append your new user home directories, then use set-nacifshomedirectory.
NAME
Set-NaCifsHomeDirectory
SYNOPSIS
Provides a list of CIFS home directory paths for the controller.
SYNTAX
Set-NaCifsHomeDirectory [-Paths] <String[]> [-Force] [-Controller <NaControl
ler>] [-WarningAction <ActionPreference>] [-WarningVariable <String>] [<Comm
onParameters>]
DESCRIPTION
Provides a list of CIFS home directory paths for the controller. Replaces th
e current list of paths in use by the controller. Note that supplying an emp
ty path list causes controller to delete any current entries.
PARAMETERS
-Paths <String[]>
An array, one entry per each CIFS home directory path.
Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-Force
If true, the new set of homedir paths will be put into use even if some
user homedir connections will be broken. This can cause users with open
files in their home directories to lose access to the files. A user can
lose data if there are updates not yet committed to disk.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Controller <NaController>
The DataONTAP controller object, embodied by an NaController object. Th
is parameter is returned by the Connect-NaController cmdlet. If not spe
cified, the value in the global variable CurrentNaController is used.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-WarningAction <ActionPreference>
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-WarningVariable <String>
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".
INPUTS
OUTPUTS
NetApp.Ontapi.Filer.Cifs.PathErrorInfo
NOTES
Category: cifs
API: cifs-homedir-paths-set
-------------- Example 1 --------------
C:\PS>Set-NaCifsHomeDirectory "/vol/vol0/user1","/vol/vol0/user2","/vol/vol0
/user3"
Set the home directories for three users (one of which doesn't exist).
ErrorPath ErrorPathDesc
--------- -------------
/vol/vol0/user3 Homedir path doesn't exist, discardi
...