Skip to content

Commit e99d5ed

Browse files
authored
Merge pull request #42 from alagoutte/readme
Update README for 0.4.0
2 parents 24c8c22 + 022ae57 commit e99d5ed

File tree

1 file changed

+116
-11
lines changed

1 file changed

+116
-11
lines changed

Diff for: README.md

+116-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
11

22
# PowerArubaCP
33

4-
This is a Powershell module for configure a Aruba ClearPass (CPPM).
5-
6-
With this module (version 0.3.0) you can manage:
7-
8-
- Network Device (Add / Get / Set / Remove a NAS)
4+
This is a Powershell module for configure an Aruba ClearPass (CPPM).
5+
6+
With this module (version 0.4.0) you can manage:
7+
8+
- API Client (Add / Get / Remove)
9+
- Application License (Add / Get / Remove)
10+
- CPPM (Get Version)
11+
- Endpoint (Add / Get / Set / Remove)
12+
- [Network Device](#NAS-Management) (Add / Get / Set / Remove a NAS)
13+
- Server (Get Configuration, Version)
14+
- Service (Get / Enable / Disable)
15+
- Static Host List ( Add / Get / Set / Remove a Static Host List and Add/Remove Member)
916
- Invoke API using Invoke-ArubaCPRestMethod
1017

18+
There is some extra feature
19+
- [Invoke API](#Invoke-API)
20+
- [Multi Connection](#MultiConnection)
21+
- [Filtering](#Filtering)
22+
1123
More functionality will be added later.
1224

13-
Tested with Aruba ClearPass (using release 6.7.x and 6.8.x)
25+
Tested with Aruba ClearPass (using release 6.7.x and 6.8.x)
26+
Application Licence, Service and Static Host List are not supported on Clearpass < 6.8.0
1427

1528
# Usage
1629

@@ -39,14 +52,18 @@ For example, you can manage NAS (NetworkDevice) with the following commands:
3952
Get-Command -Module PowerArubaCP
4053
4154
# Get help
42-
Get-Help Add-ArubaCPArubaNetwork -Full
55+
Get-Help Add-ArubaCPNetworkDevice -Full
4356
```
4457

4558
# Examples
4659

4760
### Connecting to the ClearPass using API
4861

49-
The first thing to do is to get API Client Token
62+
The first thing to do is to get API Client
63+
there is two methods to connect, using [client_id/client_secret](#Use-API-client_idclient_secret) or [token](#Use-API-Token)
64+
65+
#### Use API client_id/client_secret
66+
5067

5168
Go on WebGUI of your ClearPass, on Guest Modules
5269
![](./Medias/CPPM_Guest_API.PNG)
@@ -59,7 +76,25 @@ Create a `New API Client`
5976
- Grant type : Client credentials
6077
- Access Token Lifetime : You can increment ! (24 hours !)
6178

62-
Click on `Create API Client` (you don't need to store the Client Secet)
79+
Click on `Create API Client`
80+
81+
```powershell
82+
# Connect to the Aruba Clearpass using client_id/client_secret
83+
Connect-ArubaCP 192.0.2.1 -client_id PowerArubaCP -client_secret QRFttyxOmWX3NopMIYzKysj30wvIMxAwB6kUy7uJc67B
84+
85+
Name Value
86+
---- -----
87+
token 7aa3de0be5ea230ea92b6de0bafa14d7a76e2305
88+
invokeParams {DisableKeepAlive, SkipCertificateCheck}
89+
server 192.0.2.1
90+
port 443
91+
version 6.8.4
92+
93+
```
94+
95+
#### Use API Token
96+
97+
Like for client_id/client_secret, generate a API Client but you don't need to store the Client Secret
6398

6499
On `API Clients List`, select the your client
65100
![](./Medias/CPPM_Generate_Access_Token.PNG)
@@ -70,12 +105,19 @@ Click on `Generate Access Token`
70105
And kept the token (for example : 70680f1d19f86110800d5d5cb4414fbde7be12ae)
71106

72107

73-
After connect to a Aruba ClearPass with the command `Connect-ArubaCP` :
108+
After connect to an Aruba ClearPass with the command `Connect-ArubaCP` :
74109

75110
```powershell
76-
# Connect to the Aruba Clearpass
111+
# Connect to the Aruba Clearpass using Token
77112
Connect-ArubaCP 192.0.2.1 -token 70680f1d19f86110800d5d5cb4414fbde7be12ae
78113
114+
Name Value
115+
---- -----
116+
token 70680f1d19f86110800d5d5cb4414fbde7be12ae
117+
invokeParams {DisableKeepAlive, SkipCertificateCheck}
118+
server 192.0.2.1
119+
port 443
120+
version 6.8.4
79121
```
80122

81123
### Invoke API
@@ -150,6 +192,41 @@ You can create a new NAS `Add-ArubaCPNetworkDevice`, retrieve its information `G
150192
$nad = Get-ArubaCPNetworkDevice -name SW1
151193
$nad | Remove-ArubaCPNetworkDevice -noconfirm
152194
```
195+
196+
### MultiConnection
197+
198+
From release 0.4.0, it is possible to connect on same times to multi ClearPass
199+
You need to use -connection parameter to cmdlet
200+
201+
For example to get Vlan Ports of 2 switchs
202+
203+
```powershell
204+
# Connect to first ClearPass
205+
$cppm1 = Connect-ArubaCP 192.0.2.1 -SkipCertificateCheck -DefaultConnection:$false
206+
207+
#DefaultConnection set to false is not mandatory but only don't set the connection info on global variable
208+
209+
# Connect to second ClearPass
210+
$cppm2 = Connect-ArubaCP 192.0.2.1 -SkipCertificateCheck -DefaultConnection:$false
211+
212+
# Get Static Host List for first ClearPass
213+
Get-ArubaCPStaticHostList -connection $cppm1 | Format-Table
214+
215+
id name description host_format host_type value _links
216+
-- ---- ----------- ----------- --------- ----- ------
217+
3001 SHL-list-IPAddress list IPAddress @{self=}
218+
....
219+
# Get Static Host List for first ClearPass
220+
Get-ArubaCPStaticHostList -connection $cppm2 | Format-Table
221+
222+
id name description host_format host_type value _links
223+
-- ---- ----------- ----------- --------- ----- ------
224+
3001 SHL-list-MACAddress list MACAddress @{self=}
225+
...
226+
227+
#Each cmdlet can use -connection parameter
228+
```
229+
153230
### Filtering
154231
For `Invoke-ArubaCPRestMethod`, it is possible to use -filter parameter
155232
You need to use ClearPass API syntax :
@@ -211,15 +288,43 @@ Try to connect using `Connect-ArubaCP -SkipCertificateCheck`
211288

212289
# List of available command
213290
```powershell
291+
Add-ArubaCPApiClient
292+
Add-ArubaCPApplicationLicense
293+
Add-ArubaCPEndpoint
214294
Add-ArubaCPNetworkDevice
295+
Add-ArubaCPStaticHostList
296+
Add-ArubaCPStaticHostListMember
297+
Confirm-ArubaCPApiClient
298+
Confirm-ArubaCPApplicationLicense
299+
Confirm-ArubaCPEndpoint
215300
Confirm-ArubaCPNetworkDevice
301+
Confirm-ArubaCPService
302+
Confirm-ArubaCPStaticHostList
216303
Connect-ArubaCP
304+
Disable-ArubaCPService
217305
Disconnect-ArubaCP
306+
Enable-ArubaCPService
307+
Format-ArubaCPMacAddress
308+
Get-ArubaCPApiClient
309+
Get-ArubaCPApplicationLicense
310+
Get-ArubaCPCPPMVersion
311+
Get-ArubaCPEndpoint
218312
Get-ArubaCPNetworkDevice
313+
Get-ArubaCPServerConfiguration
314+
Get-ArubaCPServerVersion
315+
Get-ArubaCPService
316+
Get-ArubaCPStaticHostList
219317
Invoke-ArubaCPRestMethod
318+
Remove-ArubaCPApiClient
319+
Remove-ArubaCPApplicationLicense
320+
Remove-ArubaCPEndpoint
220321
Remove-ArubaCPNetworkDevice
322+
Remove-ArubaCPStaticHostList
323+
Remove-ArubaCPStaticHostListMember
221324
Set-ArubaCPCipherSSL
325+
Set-ArubaCPEndpoint
222326
Set-ArubaCPNetworkDevice
327+
Set-ArubaCPStaticHostList
223328
Set-ArubaCPuntrustedSSL
224329
Show-ArubaCPException
225330
```

0 commit comments

Comments
 (0)