ONTAP Discussions

Remove AD Domain Name from Get-NcQuotaReport

EdS

We have a PowerShell script that reports on the top 50 consumers on one of our volumes.  The volume has tracing quotas enabled so we are using Get-NcQuotaReport to get the information.  The username returned from Get-NcQuotaReport comes back as DomainName\Username via $_QuotaUsers.QuotaUserName. Is there a way via an inline expression to remove the "DomainName\" from the output?  Here is how we get the output.

 

$diskused = Get-NcQuotaReport | Where-Object {$_.Volume -eq 'OurVolume'} | Where-Object {$_.QuotaUsers.QuotaUserName -notlike '*Admin*'} | select QuotaUsers,DiskUsed


$diskused | Sort-Object -Unique -Descending { [int64]$_.DiskUsed} |
Format-Table @{Name='Username';Expression={$_.QuotaUsers.QuotaUserName}}, @{Name='GigaBytes';Expression={($_.DiskUsed -shr 20)};align='right'; Width=10} |
Select-Object -First 50 | Out-String -Width 80 |
Out-File $reportfile -Append

 

1 ACCEPTED SOLUTION

JGPSHNTAP
2 REPLIES 2

JGPSHNTAP

EdS
Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public