cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Disclaimer
JUMPCLOUD EXPRESSLY DISCLAIMS ALL REPRESENTATIONS, WARRANTIES, CONDITIONS, AND LIABILITIES OF ANY KIND ARISING FROM OR RELATED TO THIRD-PARTY SOFTWARE, SCRIPTS, REPOSITORIES, AND APIS. JUMPCLOUD IS NOT REQUIRED TO SUPPORT ANY SUCH THIRD-PARTY MATERIALS AND ALL RISKS RELATED TO THIRD-PARTY MATERIALS ARE YOUR RESPONSIBILITY. PLEASE ALSO REVIEW THE JUMPCLOUD TOS.

List Local & Managed User Accounts in Your Fleet

RyanBailey
Novitiate III

Hey folks!

Few threads have popped up recently in the JumpCloud Slack asking if there is any method to pull all user accounts from your fleet for compliance reasons. If you have System Insights, the code below should do the trick! This is a quick code snippet, no error handling etc... Always looking for feedback, let me know if you'd tackle this from a different angle!

 

$systems = Get-JCSystem
$usersBySystem = Get-JCSystem | ForEach-Object {Get-JcSdkSystemInsightUser -Filter "system_id:eq:$($_._id)"} | Select-Object -Property @{
    Name = "Hostname"; Expression = {
        $sysId = $_.SystemId
        $systems | Where-Object { $_._id -eq $sysId } | Select-Object -ExpandProperty hostname
    }}, AdManaged, Admin, Description, Directory, Gid, GidSigned, LastLogin, Managed, RealUser, Shell, Suspended, SystemId, Type, Uid, UidSigned, Username, Uuid
    
$usersBySystem | Export-Csv -Path .\SystemUsers.csv -Force -NoClobber

 

2 REPLIES 2

BenGarrison
JumpCloud Alumni
JumpCloud Alumni

This is awesome! Great work Ryan, thanks for the awesomeness.
BenGarrison_0-1655820262459.gif

tekrondo
Novitiate II

Thanks a lot, Ryan! Your patience and willingness to help and most especially, this script!

You Might Like

New to the site? Take a look at these additional resources:

Community created scripts:

Our new Radical Admin blog:

Keep up with Product News:

Read our community guidelines

Ready to join us? You can register here.