-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add function to create and manage Guests #7
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
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 ?
PowerArubaCP/Public/Guest.ps1
Outdated
.DESCRIPTION | ||
Add Guest account on Aruba ClearPass | ||
.EXAMPLE | ||
Add-ArubaCPGuest -username -company -mail -role [-enable] [-expire] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove [-enable] -expire]
There was a problem hiding this comment.
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
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 [email protected] -role 2 -enable True |
There was a problem hiding this comment.
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 ? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
??
There was a problem hiding this comment.
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")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use switch type ? :)
There was a problem hiding this comment.
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')) |
There was a problem hiding this comment.
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
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)]/ |
There was a problem hiding this comment.
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")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use switch..
PowerArubaCP/Public/Guest.ps1
Outdated
[ValidateSet ("true", "false")] | ||
[string]$enable, | ||
[Parameter(Mandatory = $false)] | ||
[String]$expire |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use direct timestamp value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
??
There was a problem hiding this comment.
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)
PowerArubaCP/Public/Guest.ps1
Outdated
|
||
if ( $PsBoundParameters.ContainsKey('role')) | ||
{ | ||
switch( $role ) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
No description provided.