Solved

changing custom attribute label in a powerhsell report

Posted on 2014-11-17
2
170 Views
Last Modified: 2014-11-17
Hi everyone

I have create a simple powershell script which include extension Attribute

my question: is it possible to change extensionAttribute label for one of my own

Get-ADUser -Filter * -properties extensionAttribute1, extensionAttribute2, extensionAttribute3, extensionAttribute15 -SearchBase "DC=gsp,DC=com" |
        SELECT Name, samaccountname, GymCard, LDCode, PrinterCode, OldLDCode , @{name="OU";expression={($_.DistinguishedName -split ",OU=")[1]}} |
        Sort-Object samaccountname
0
Comment
Question by:Physimed
2 Comments
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 40447638
You can create a custom property in the format @{N="GymCard";E={$_.extensionAttribute1}}

For example..
Get-ADUser -Filter * -properties extensionAttribute1, extensionAttribute2, extensionAttribute3, extensionAttribute15 -SearchBase "DC=gsp,DC=com" | 
         SELECT Name, samaccountname, @{N="GymCard";E={$_.extensionAttribute1}},@{N="LDCode";E={$_.extensionAttribute2}},@{N="PrinterCode";E={$_.extensionAttribute3}},@{N="OldLDCode";E={$_.extensionAttribute15}}, @{N="OU";E={($_.DistinguishedName -split ",OU=")[1]}} |
         Sort-Object samaccountname 

Open in new window

0
 

Author Closing Comment

by:Physimed
ID: 40447664
Straight to the point

I tries and it works just fine
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article will help you understand what HashTables are and how to use them in PowerShell.
A brief introduction to what I consider to be the best editor for PowerShell.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now