Skip to content

Add function to create and manage Guests - #7

Open
CedricMoreau wants to merge 3 commits into
PowerAruba:masterfrom
CedricMoreau:Guest
Open

Add function to create and manage Guests#7
CedricMoreau wants to merge 3 commits into
PowerAruba:masterfrom
CedricMoreau:Guest

Conversation

@CedricMoreau

Copy link
Copy Markdown
Contributor

No description provided.

@alagoutte alagoutte added the need-test Need a test (psester) integration label Oct 7, 2018

@alagoutte alagoutte left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to add cmdlet to remove a guest ?

Comment thread PowerArubaCP/Public/Guest.ps1
Comment thread PowerArubaCP/Public/Guest.ps1
Comment thread PowerArubaCP/Public/Guest.ps1 Outdated
.DESCRIPTION
Add Guest account on Aruba ClearPass
.EXAMPLE
Add-ArubaCPGuest -username -company -mail -role [-enable] [-expire]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove [-enable] -expire]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and make a really example

Comment thread PowerArubaCP/Public/Guest.ps1 Outdated
Add-ArubaCPGuest -username -company -mail -role [-enable] [-expire]
Add the guest account with parameters.
.EXAMPLE
Add-ArubaCPGuest -username matthew -company "Interstellar & Co" -mail matt.hew@matthew.com -role 2 -enable True

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add Power and Aruba user ? :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

??

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About the name of user add on your example ;)

[Parameter(Mandatory = $true)]
[int]$role,
[Parameter(Mandatory = $false)]
[ValidateSet ("True", "False")]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use switch type ? :)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No yet fixed


$guest | add-member -name "role_id" -membertype NoteProperty -Value $role

if ( $PsBoundParameters.ContainsKey('enable'))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use switch type it will be more easy

Comment thread PowerArubaCP/Public/Guest.ps1 Outdated
.DESCRIPTION
Set information about a guest account based on his username on Aruba ClearPass.
.EXAMPLE
Set-ArubaCPGuest -username test [-company] [-mail] [-role (1/2/3)] [-enable (true/false)] [-expire (hour/day/week/month/year)]/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

real example

[ValidateRange (1,3)]
[int]$role,
[Parameter(Mandatory = $false)]
[ValidateSet ("true", "false")]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use switch..

Comment thread PowerArubaCP/Public/Guest.ps1 Outdated
[ValidateSet ("true", "false")]
[string]$enable,
[Parameter(Mandatory = $false)]
[String]$expire

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use direct timestamp value

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

??

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

directly send the timestamp to the function (the conversion number of day to timestamp need to be make by user on the script but not in this module)

Comment thread PowerArubaCP/Public/Guest.ps1 Outdated

if ( $PsBoundParameters.ContainsKey('role'))
{
switch( $role ) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing that, only need to pass the role id/number

@alagoutte alagoutte left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need some rework before merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

need-test Need a test (psester) integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants