You are going to have to test that as per your environment.
net use might not required admin privileges, but other parts of the script may.
If it works without an admin account, then you do not to add the admin user account on the External Account tab.
-------------------------------------------
Original Message:
Sent: Oct 06, 2025 05:23 AM
From: Fcbeng1202
Subject: Clearpass OnGuard - Execute Script upon Health status change and COA
Thanks Vigan,
Are you sure there is a need for an admin account ? I previously used a custom script to detect some cert on a local machine at user level and it did not seem to be required.
And since laptop are LAPS enabled this will be nearly impossible to achieve.
To me, the net use command don't need admin rights and if there is no specific restrictions on executing PS scripts it should be doable ?
Thanks
Original Message:
Sent: Oct 06, 2025 04:10 AM
From: vigan
Subject: Clearpass OnGuard - Execute Script upon Health status change and COA
Hi,
Just to be clear, there are three types of Custom Scripts that you can deploy using OnGuard.
- Health Collection,
- Auto Remediation
- Agent Enforcement Enforcement Profile.
Based on the information that you provided above I assume that you are going to be doing a Agent Enforcement Enforcement Profile, right?
Technically you can achieve that.
Here is a sample .ps1 script that will help you achieve that, but note that you will have to make adjustments.
# SimpleMapDrive.ps1$share = "\\fileserver\shared"$drive = "Z:"# Wait a few seconds to ensure network access after COAStart-Sleep -Seconds 10# Try to map the drivetry { New-PSDrive -Name $drive.TrimEnd(':') -PSProvider FileSystem -Root $share -Persist -ErrorAction Stop Write-Host "Drive $drive mapped to $share successfully."}catch { Write-Host "Failed to map drive. Please check network access or credentials."}
When you have the script on the Endpoint, please also make sure that these attributes are filled in correctly.

Lastly, you have to make sure that you have a local admin, or a admin user in any case that will be able to execute this script on the Endpoint., which is located under Administration>External Accounts, click on Add and it should be a Domain/WMI user.
One thing left to do afterwards is to push this enforcement profile on the service that you are using and troubleshoot any issues from there.
Hopefully this will answer your question.
Cheers,
Vigan
Original Message:
Sent: Sep 26, 2025 03:13 AM
From: Fcbeng1202
Subject: Clearpass OnGuard - Execute Script upon Health status change and COA
Hi there,
I was wondering if it is possible for Onguard to run a script on a machine after a device posture becomes "healthy" and the COA gives the device network access.
To be clear, I want OnGuard to trigger the mount of network shares (net use) only after the device has access to the network.
Thank you in advance for the help.
Cheers
-------------------------------------------