none
Pager Value for AD user RRS feed

  • Question

  • Hi, am trying to set Pager value for user while creating AD user name using PowerShell script. However am getting below error for setting pager value. 

    Property 'pager' cannot be found on this object; make sure it exists and is

    settable.
    At D:\ADUsers\AD - User Creation\User creation with groups addtion\AD.ps1:30
    char:1
    + $UserN.pager = $Pgr
    + ~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : PropertyNotFound

    Set-ADUser : Cannot validate argument on parameter 'Instance'. The argument is
    null. Supply a non-null argument and try the command again.
    At D:\ADUsers\AD - User Creation\User creation with groups addtion\AD.ps1:31
    char:22
    + Set-ADUser -instance $UserN
    +                      ~~~~~~
        + CategoryInfo          : InvalidData: (:) [Set-ADUser], ParameterBindingV
       alidationException
        + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.Activ
       eDirectory.Management.Commands.SetADUser

    My Code snippet for assigning pager value is

    $UserN = Get-ADUser -Filter {UserPrincipalName -eq $UserPrincipalName} -Properties pager 

    $UserN.pager = $Pgr
    Set-ADUser -instance $UserN 

    Your help on this would be much appreciated.  Thanks

    Tuesday, May 5, 2015 8:26 AM

Answers

  • To modify the pager use this:

    Get-ADUser -Filter "UserPrincipalName -eq $UserPrincipalName" | Set-ADUser -Replace @{pager=$pagernumber}

    To add a pager the first time use this:

    Get-ADUser -Filter "UserPrincipalName -eq $UserPrincipalName" | Set-ADUser -Add @{pager=$pagernumber}

    In AD the pager number attribute is "Pager" not "Phone-Pager-Primary" which is the schema reference.

    With New-AdUser it is added as -OtherAttribute @{pager=$number}


    \_(ツ)_/


    Tuesday, May 5, 2015 9:21 AM

All replies

  • Pager is the display name, the RDN is Phone-Pager-Primary

    REF: https://msdn.microsoft.com/en-us/library/ms679102(v=vs.85).aspx


    This post is provided AS IS with no warranties or guarantees, and confers no rights.
    ~~~
    Questo post non fornisce garanzie e non conferisce diritti

    Tuesday, May 5, 2015 8:37 AM
  • To modify the pager use this:

    Get-ADUser -Filter "UserPrincipalName -eq $UserPrincipalName" | Set-ADUser -Replace @{pager=$pagernumber}

    To add a pager the first time use this:

    Get-ADUser -Filter "UserPrincipalName -eq $UserPrincipalName" | Set-ADUser -Add @{pager=$pagernumber}

    In AD the pager number attribute is "Pager" not "Phone-Pager-Primary" which is the schema reference.

    With New-AdUser it is added as -OtherAttribute @{pager=$number}


    \_(ツ)_/


    Tuesday, May 5, 2015 9:21 AM
  • That's right, would have make sense though

    This post is provided AS IS with no warranties or guarantees, and confers no rights.
    ~~~
    Questo post non fornisce garanzie e non conferisce diritti

    Tuesday, May 5, 2015 9:27 AM