Use PowerShell to Manage User and User’s Home Directory
Gladinet Cloud Enterprise is a private file sync and share solution for enterprise. As an administrator for the Gladinet Cloud Enterprise solution, you may be responsible for setting up home directories for users in the solution.
PowerShell is very convenient for this kind of task. Today’s example is using PowerShell to setup a home directory version folder after the user has been created.
For demonstration purpose, we will use the PowerShell ISE. Since the ISE has the help panel, it is very easy to see each PowerShell commands.
In this example, The GCE server is at 192.168.2.11, the administrator is joe@gladinet.com and the password is dddddddd.
PowerShell ISE
PS D:\> Import-Module .\GCEAutomation.dll
PS D:\> $login = Get-GceLogin joe@gladinet.com dddddddd http://192.168.2.11
PS D:\> $login
Cookie : b5T0TszRmZ7Qdq2CkrKtqEJpdFgfqBgMd/GelzWuhTmAd16JSO6b34IUiCQ3AXwdNqq2byXjFUjKp0KIGxK1a43WDZqrJj/aM2GZnjxtOp
xPqilv
NSEndPoint : http://192.168.2.11/namespace/n.svc/
LSEndPoint : http://localhost:8080/localstor/n.svc/
RelayServer :
Hours : 4
User : user.SingleUser
PortalServer : http://192.168.2.11/portal/
BrandingProductName : Gladinet Cloud
KeepCmdChannel : False
SupportSetLastModified : True
WCVersion :
ForceVersioned : False
Success : True
Reason :
Context :
Context1 :
Acquire a User Guid
The administrator can create version folder for an end user. In this example, we just use the User Guid for the administrator himself. You can also get the user’s guid some other ways. For example, the user’s guid is returned when you just create the user.
PS D:\> $login.User.UserGuid
Guid
----
0961d650-d280-49f5-8822-d933b3f63801
Add-GceVersionFolderForUser
PS D:\> $result = Add-GceVersionFolderForUser -FolderName "joe-home-folder" -UserGuid $login.User.UserGuid -LoginToken $login.Cookie -ServerUrl http://192.168.2.11
PS D:\> $result
Success Reason Context Context1
------- ------ ------- --------
True
Verify The Folder is Created
For more information, visit http://www.gladinet.com
Comments