Hello. So I have this code:<\/p>\n
$lockout1 = Search-ADAccount -LockedOut -server DC1602.orion.universe.lcl | Select-Object *\n$lockout3 = foreach($entry in $lockout1.samaccountname)\n{\nGet-aduser -filter \"samaccountname -eq '$entry'\" -properties * | select-object name, samaccountname, title, displayname, lockedout, enabled, passwordexpired \n}\n\n$list = [pscustomobject]@{\n Name = $lockout1.name\n SamAccountName = $lockout3.samaccountname\n Title = $lockout3.title \n DisplayName = $lockout3.displayname\n Lockedout = $lockout1.LockedOut\n Enabled = $lockout3.enabled\n PasswordExpired = $lockout3.passwordexpired\n } \n$list\n<\/code><\/pre>\n Advertisement Close That returns this output:\n<\/use><\/svg>image<\/span>577×137 3.95 KB<\/span><\/use><\/svg><\/div><\/a><\/div><\/p>\n Advertisement Close How can I set it so that the output doesn’t appear as comma-separated underneath the individual headings?<\/p>\nDoing a format-table -autosize doesn’t work. Google searches haven’t yielded any answers.<\/p>\nLet me know if you have any suggestions. Thanks!<\/p>","upvoteCount":5,"answerCount":12,"datePublished":"2025-07-08T23:52:53.026Z","author":{"@type":"Person","name":"michaellopez3","url":"https://community.spiceworks.com/u/michaellopez3"},"acceptedAnswer":{"@type":"Answer","text":"I ultimately ended up using this code:<\/p>\n$lockout1 = Search-ADAccount -LockedOut -server DC1602.orion.universe.lcl | Select-Object SamAccountName, lockedout\n$lockout3 = foreach($entry in $lockout1.samaccountname)\n{\nGet-aduser -filter \"samaccountname -eq '$entry'\" -properties * | select-object name, @{N='SamAccountName';E={$_.samaccountname}}, title, displayname, enabled, passwordexpired \n}\n$joinobjects2 = $lockout1 | join-object ($lockout3) -on \"SamAccountName\" | select-object Name, SamAccountName, title, displayname, lockedout, enabled, passwordexpired \nwrite-output $joinobjects2 | format-table -autosize\n\n<\/code><\/pre>\nJoinobject is a third party module. (PowerShell Gallery | Join-Object 2.0.3<\/a>)<\/p>\nSeems as if pscustomobject wasn’t quite what I was seeking, unfortunately.<\/p>","upvoteCount":0,"datePublished":"2025-07-17T17:26:44.854Z","url":"https://community.spiceworks.com/t/powershell-pscustomobject-issue/1222185/8","author":{"@type":"Person","name":"michaellopez3","url":"https://community.spiceworks.com/u/michaellopez3"}},"suggestedAnswer":[{"@type":"Answer","text":"Hello. So I have this code:<\/p>\n$lockout1 = Search-ADAccount -LockedOut -server DC1602.orion.universe.lcl | Select-Object *\n$lockout3 = foreach($entry in $lockout1.samaccountname)\n{\nGet-aduser -filter \"samaccountname -eq '$entry'\" -properties * | select-object name, samaccountname, title, displayname, lockedout, enabled, passwordexpired \n}\n\n$list = [pscustomobject]@{\n Name = $lockout1.name\n SamAccountName = $lockout3.samaccountname\n Title = $lockout3.title \n DisplayName = $lockout3.displayname\n Lockedout = $lockout1.LockedOut\n Enabled = $lockout3.enabled\n PasswordExpired = $lockout3.passwordexpired\n } \n$list\n<\/code><\/pre>\nThat returns this output:\n<\/use><\/svg>image<\/span>577×137 3.95 KB<\/span><\/use><\/svg><\/div><\/a><\/div><\/p>\nHow can I set it so that the output doesn’t appear as comma-separated underneath the individual headings?<\/p>\nDoing a format-table -autosize doesn’t work. Google searches haven’t yielded any answers.<\/p>\nLet me know if you have any suggestions. Thanks!<\/p>","upvoteCount":5,"datePublished":"2025-07-08T23:52:53.090Z","url":"https://community.spiceworks.com/t/powershell-pscustomobject-issue/1222185/1","author":{"@type":"Person","name":"michaellopez3","url":"https://community.spiceworks.com/u/michaellopez3"}},{"@type":"Answer","text":"it basically has multiple entries, so another foreach, or you write it better.<\/p>\ne.g.<\/p>\n$lockout1 = Search-ADAccount -LockedOut -Server 'DC1602.orion.universe.lcl'\n\nforeach ($entry in $lockout1.samaccountname) {\n $AD = $null\n $AD = Get-aduser -Identity $entry -properties title, displayname,lockedout,passwordexpired | \n select-object name, samaccountname, title, displayname, lockedout, enabled, passwordexpired\n\n [pscustomobject]@{\n Name = $AD.name\n SamAccountName = $AD.samaccountname\n Title = $AD.title \n DisplayName = $AD.displayname\n Lockedout = $AD.LockedOut\n Enabled = $AD.enabled\n PasswordExpired = $AD.passwordexpired\n } \n}\n<\/code><\/pre>","upvoteCount":4,"datePublished":"2025-07-09T03:00:19.268Z","url":"https://community.spiceworks.com/t/powershell-pscustomobject-issue/1222185/2","author":{"@type":"Person","name":"Neally","url":"https://community.spiceworks.com/u/Neally"}},{"@type":"Answer","text":"Removing all the $List stuff should output the desired results and store it in $lockout3<\/p>","upvoteCount":1,"datePublished":"2025-07-09T05:43:47.531Z","url":"https://community.spiceworks.com/t/powershell-pscustomobject-issue/1222185/3","author":{"@type":"Person","name":"adminofthings","url":"https://community.spiceworks.com/u/adminofthings"}},{"@type":"Answer","text":"
That returns this output:\n
How can I set it so that the output doesn’t appear as comma-separated underneath the individual headings?<\/p>\n
Doing a format-table -autosize doesn’t work. Google searches haven’t yielded any answers.<\/p>\n
Let me know if you have any suggestions. Thanks!<\/p>","upvoteCount":5,"answerCount":12,"datePublished":"2025-07-08T23:52:53.026Z","author":{"@type":"Person","name":"michaellopez3","url":"https://community.spiceworks.com/u/michaellopez3"},"acceptedAnswer":{"@type":"Answer","text":"
I ultimately ended up using this code:<\/p>\n
$lockout1 = Search-ADAccount -LockedOut -server DC1602.orion.universe.lcl | Select-Object SamAccountName, lockedout\n$lockout3 = foreach($entry in $lockout1.samaccountname)\n{\nGet-aduser -filter \"samaccountname -eq '$entry'\" -properties * | select-object name, @{N='SamAccountName';E={$_.samaccountname}}, title, displayname, enabled, passwordexpired \n}\n$joinobjects2 = $lockout1 | join-object ($lockout3) -on \"SamAccountName\" | select-object Name, SamAccountName, title, displayname, lockedout, enabled, passwordexpired \nwrite-output $joinobjects2 | format-table -autosize\n\n<\/code><\/pre>\nJoinobject is a third party module. (PowerShell Gallery | Join-Object 2.0.3<\/a>)<\/p>\nSeems as if pscustomobject wasn’t quite what I was seeking, unfortunately.<\/p>","upvoteCount":0,"datePublished":"2025-07-17T17:26:44.854Z","url":"https://community.spiceworks.com/t/powershell-pscustomobject-issue/1222185/8","author":{"@type":"Person","name":"michaellopez3","url":"https://community.spiceworks.com/u/michaellopez3"}},"suggestedAnswer":[{"@type":"Answer","text":"Hello. So I have this code:<\/p>\n$lockout1 = Search-ADAccount -LockedOut -server DC1602.orion.universe.lcl | Select-Object *\n$lockout3 = foreach($entry in $lockout1.samaccountname)\n{\nGet-aduser -filter \"samaccountname -eq '$entry'\" -properties * | select-object name, samaccountname, title, displayname, lockedout, enabled, passwordexpired \n}\n\n$list = [pscustomobject]@{\n Name = $lockout1.name\n SamAccountName = $lockout3.samaccountname\n Title = $lockout3.title \n DisplayName = $lockout3.displayname\n Lockedout = $lockout1.LockedOut\n Enabled = $lockout3.enabled\n PasswordExpired = $lockout3.passwordexpired\n } \n$list\n<\/code><\/pre>\nThat returns this output:\n<\/use><\/svg>image<\/span>577×137 3.95 KB<\/span><\/use><\/svg><\/div><\/a><\/div><\/p>\nHow can I set it so that the output doesn’t appear as comma-separated underneath the individual headings?<\/p>\nDoing a format-table -autosize doesn’t work. Google searches haven’t yielded any answers.<\/p>\nLet me know if you have any suggestions. Thanks!<\/p>","upvoteCount":5,"datePublished":"2025-07-08T23:52:53.090Z","url":"https://community.spiceworks.com/t/powershell-pscustomobject-issue/1222185/1","author":{"@type":"Person","name":"michaellopez3","url":"https://community.spiceworks.com/u/michaellopez3"}},{"@type":"Answer","text":"it basically has multiple entries, so another foreach, or you write it better.<\/p>\ne.g.<\/p>\n$lockout1 = Search-ADAccount -LockedOut -Server 'DC1602.orion.universe.lcl'\n\nforeach ($entry in $lockout1.samaccountname) {\n $AD = $null\n $AD = Get-aduser -Identity $entry -properties title, displayname,lockedout,passwordexpired | \n select-object name, samaccountname, title, displayname, lockedout, enabled, passwordexpired\n\n [pscustomobject]@{\n Name = $AD.name\n SamAccountName = $AD.samaccountname\n Title = $AD.title \n DisplayName = $AD.displayname\n Lockedout = $AD.LockedOut\n Enabled = $AD.enabled\n PasswordExpired = $AD.passwordexpired\n } \n}\n<\/code><\/pre>","upvoteCount":4,"datePublished":"2025-07-09T03:00:19.268Z","url":"https://community.spiceworks.com/t/powershell-pscustomobject-issue/1222185/2","author":{"@type":"Person","name":"Neally","url":"https://community.spiceworks.com/u/Neally"}},{"@type":"Answer","text":"Removing all the $List stuff should output the desired results and store it in $lockout3<\/p>","upvoteCount":1,"datePublished":"2025-07-09T05:43:47.531Z","url":"https://community.spiceworks.com/t/powershell-pscustomobject-issue/1222185/3","author":{"@type":"Person","name":"adminofthings","url":"https://community.spiceworks.com/u/adminofthings"}},{"@type":"Answer","text":"
Joinobject is a third party module. (PowerShell Gallery | Join-Object 2.0.3<\/a>)<\/p>\nSeems as if pscustomobject wasn’t quite what I was seeking, unfortunately.<\/p>","upvoteCount":0,"datePublished":"2025-07-17T17:26:44.854Z","url":"https://community.spiceworks.com/t/powershell-pscustomobject-issue/1222185/8","author":{"@type":"Person","name":"michaellopez3","url":"https://community.spiceworks.com/u/michaellopez3"}},"suggestedAnswer":[{"@type":"Answer","text":"Hello. So I have this code:<\/p>\n$lockout1 = Search-ADAccount -LockedOut -server DC1602.orion.universe.lcl | Select-Object *\n$lockout3 = foreach($entry in $lockout1.samaccountname)\n{\nGet-aduser -filter \"samaccountname -eq '$entry'\" -properties * | select-object name, samaccountname, title, displayname, lockedout, enabled, passwordexpired \n}\n\n$list = [pscustomobject]@{\n Name = $lockout1.name\n SamAccountName = $lockout3.samaccountname\n Title = $lockout3.title \n DisplayName = $lockout3.displayname\n Lockedout = $lockout1.LockedOut\n Enabled = $lockout3.enabled\n PasswordExpired = $lockout3.passwordexpired\n } \n$list\n<\/code><\/pre>\nThat returns this output:\n<\/use><\/svg>image<\/span>577×137 3.95 KB<\/span><\/use><\/svg><\/div><\/a><\/div><\/p>\nHow can I set it so that the output doesn’t appear as comma-separated underneath the individual headings?<\/p>\nDoing a format-table -autosize doesn’t work. Google searches haven’t yielded any answers.<\/p>\nLet me know if you have any suggestions. Thanks!<\/p>","upvoteCount":5,"datePublished":"2025-07-08T23:52:53.090Z","url":"https://community.spiceworks.com/t/powershell-pscustomobject-issue/1222185/1","author":{"@type":"Person","name":"michaellopez3","url":"https://community.spiceworks.com/u/michaellopez3"}},{"@type":"Answer","text":"it basically has multiple entries, so another foreach, or you write it better.<\/p>\ne.g.<\/p>\n$lockout1 = Search-ADAccount -LockedOut -Server 'DC1602.orion.universe.lcl'\n\nforeach ($entry in $lockout1.samaccountname) {\n $AD = $null\n $AD = Get-aduser -Identity $entry -properties title, displayname,lockedout,passwordexpired | \n select-object name, samaccountname, title, displayname, lockedout, enabled, passwordexpired\n\n [pscustomobject]@{\n Name = $AD.name\n SamAccountName = $AD.samaccountname\n Title = $AD.title \n DisplayName = $AD.displayname\n Lockedout = $AD.LockedOut\n Enabled = $AD.enabled\n PasswordExpired = $AD.passwordexpired\n } \n}\n<\/code><\/pre>","upvoteCount":4,"datePublished":"2025-07-09T03:00:19.268Z","url":"https://community.spiceworks.com/t/powershell-pscustomobject-issue/1222185/2","author":{"@type":"Person","name":"Neally","url":"https://community.spiceworks.com/u/Neally"}},{"@type":"Answer","text":"Removing all the $List stuff should output the desired results and store it in $lockout3<\/p>","upvoteCount":1,"datePublished":"2025-07-09T05:43:47.531Z","url":"https://community.spiceworks.com/t/powershell-pscustomobject-issue/1222185/3","author":{"@type":"Person","name":"adminofthings","url":"https://community.spiceworks.com/u/adminofthings"}},{"@type":"Answer","text":"
Seems as if pscustomobject wasn’t quite what I was seeking, unfortunately.<\/p>","upvoteCount":0,"datePublished":"2025-07-17T17:26:44.854Z","url":"https://community.spiceworks.com/t/powershell-pscustomobject-issue/1222185/8","author":{"@type":"Person","name":"michaellopez3","url":"https://community.spiceworks.com/u/michaellopez3"}},"suggestedAnswer":[{"@type":"Answer","text":"
$lockout1 = Search-ADAccount -LockedOut -server DC1602.orion.universe.lcl | Select-Object *\n$lockout3 = foreach($entry in $lockout1.samaccountname)\n{\nGet-aduser -filter \"samaccountname -eq '$entry'\" -properties * | select-object name, samaccountname, title, displayname, lockedout, enabled, passwordexpired \n}\n\n$list = [pscustomobject]@{\n Name = $lockout1.name\n SamAccountName = $lockout3.samaccountname\n Title = $lockout3.title \n DisplayName = $lockout3.displayname\n Lockedout = $lockout1.LockedOut\n Enabled = $lockout3.enabled\n PasswordExpired = $lockout3.passwordexpired\n } \n$list\n<\/code><\/pre>\nThat returns this output:\n<\/use><\/svg>image<\/span>577×137 3.95 KB<\/span><\/use><\/svg><\/div><\/a><\/div><\/p>\nHow can I set it so that the output doesn’t appear as comma-separated underneath the individual headings?<\/p>\nDoing a format-table -autosize doesn’t work. Google searches haven’t yielded any answers.<\/p>\nLet me know if you have any suggestions. Thanks!<\/p>","upvoteCount":5,"datePublished":"2025-07-08T23:52:53.090Z","url":"https://community.spiceworks.com/t/powershell-pscustomobject-issue/1222185/1","author":{"@type":"Person","name":"michaellopez3","url":"https://community.spiceworks.com/u/michaellopez3"}},{"@type":"Answer","text":"it basically has multiple entries, so another foreach, or you write it better.<\/p>\ne.g.<\/p>\n$lockout1 = Search-ADAccount -LockedOut -Server 'DC1602.orion.universe.lcl'\n\nforeach ($entry in $lockout1.samaccountname) {\n $AD = $null\n $AD = Get-aduser -Identity $entry -properties title, displayname,lockedout,passwordexpired | \n select-object name, samaccountname, title, displayname, lockedout, enabled, passwordexpired\n\n [pscustomobject]@{\n Name = $AD.name\n SamAccountName = $AD.samaccountname\n Title = $AD.title \n DisplayName = $AD.displayname\n Lockedout = $AD.LockedOut\n Enabled = $AD.enabled\n PasswordExpired = $AD.passwordexpired\n } \n}\n<\/code><\/pre>","upvoteCount":4,"datePublished":"2025-07-09T03:00:19.268Z","url":"https://community.spiceworks.com/t/powershell-pscustomobject-issue/1222185/2","author":{"@type":"Person","name":"Neally","url":"https://community.spiceworks.com/u/Neally"}},{"@type":"Answer","text":"Removing all the $List stuff should output the desired results and store it in $lockout3<\/p>","upvoteCount":1,"datePublished":"2025-07-09T05:43:47.531Z","url":"https://community.spiceworks.com/t/powershell-pscustomobject-issue/1222185/3","author":{"@type":"Person","name":"adminofthings","url":"https://community.spiceworks.com/u/adminofthings"}},{"@type":"Answer","text":"
Let me know if you have any suggestions. Thanks!<\/p>","upvoteCount":5,"datePublished":"2025-07-08T23:52:53.090Z","url":"https://community.spiceworks.com/t/powershell-pscustomobject-issue/1222185/1","author":{"@type":"Person","name":"michaellopez3","url":"https://community.spiceworks.com/u/michaellopez3"}},{"@type":"Answer","text":"
it basically has multiple entries, so another foreach, or you write it better.<\/p>\n
e.g.<\/p>\n
$lockout1 = Search-ADAccount -LockedOut -Server 'DC1602.orion.universe.lcl'\n\nforeach ($entry in $lockout1.samaccountname) {\n $AD = $null\n $AD = Get-aduser -Identity $entry -properties title, displayname,lockedout,passwordexpired | \n select-object name, samaccountname, title, displayname, lockedout, enabled, passwordexpired\n\n [pscustomobject]@{\n Name = $AD.name\n SamAccountName = $AD.samaccountname\n Title = $AD.title \n DisplayName = $AD.displayname\n Lockedout = $AD.LockedOut\n Enabled = $AD.enabled\n PasswordExpired = $AD.passwordexpired\n } \n}\n<\/code><\/pre>","upvoteCount":4,"datePublished":"2025-07-09T03:00:19.268Z","url":"https://community.spiceworks.com/t/powershell-pscustomobject-issue/1222185/2","author":{"@type":"Person","name":"Neally","url":"https://community.spiceworks.com/u/Neally"}},{"@type":"Answer","text":"Removing all the $List stuff should output the desired results and store it in $lockout3<\/p>","upvoteCount":1,"datePublished":"2025-07-09T05:43:47.531Z","url":"https://community.spiceworks.com/t/powershell-pscustomobject-issue/1222185/3","author":{"@type":"Person","name":"adminofthings","url":"https://community.spiceworks.com/u/adminofthings"}},{"@type":"Answer","text":"
Removing all the $List stuff should output the desired results and store it in $lockout3<\/p>","upvoteCount":1,"datePublished":"2025-07-09T05:43:47.531Z","url":"https://community.spiceworks.com/t/powershell-pscustomobject-issue/1222185/3","author":{"@type":"Person","name":"adminofthings","url":"https://community.spiceworks.com/u/adminofthings"}},{"@type":"Answer","text":"