Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • PowerCLI Cookbook
  • Toc
  • feedback
PowerCLI Cookbook

PowerCLI Cookbook

By : Philip Brandon Sellers
4.8 (4)
close
PowerCLI Cookbook

PowerCLI Cookbook

4.8 (4)
By: Philip Brandon Sellers

Overview of this book

If you are a virtualization professional who wants to unleash the power of automation and combat the complexity of sprawling virtual environments, this book is ideal for you. This book will enhance your skills of administering VMware vSphere and vCloud Director with PowerCLI.
Table of Contents (13 chapters)
close
12
Index

Creating a new user in an organization using Views


In this recipe, since PowerCLI does not yet have a New-CIUser cmdlet, you will write a function to handle this process. The function requires to have the correct rights to create organizational users, but it will allow you to create users from PowerCLI without having to switch back to the web console. The code and function are based on a blog post from Alan Renouf, a product manager who focuses on automation frameworks and CLI at VMware.

Getting ready

To begin this recipe, open PowerShell ISE and set up a VMware PowerCLI environment by adding the PSSnapIn cmdlet, VMware.VimAutomation.Core.

How to do it…

In order to create a new user in an organization using Views, perform the following steps:

  1. In PowerShell ISE, set up a basic function definition for New-CIUser:

    Function New-CIUser {
    
  2. Next, add your synopsis and help text to the function:

    <#
    .SYNOPSIS
      Creates a new user in a vCloud installation
    .DESCRIPTION
      Creates a new user account in...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete