Solved

changing custom attribute label in a powerhsell report

Posted on 2014-11-17
2
182 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
In previous parts of this Nano Server deployment series, we learned how to create, deploy and configure Nano Server as a Hyper-V host. In this part, we will look for a clustering option. We will create a Hyper-V cluster of 3 Nano Server host nodes w…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

751 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