Important Notice: On February 29th, this community will be put into read-only mode. All existing posts will remain but customers will be unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Change AD Description for a Remote Computer

Hey,

A simple tool I use to modify(replace) the AD Description of a Remote Computer, and then triggers a Scan for AD Infos right after.

 

$description = Read-Host 'Entrez la description voulue '
Set-ADComputer $(Computer:TARGET) -replace:@{"description"="$($description)"}
Invoke-Command -ScriptBlock {pdqinventory ScanComputers -Computers "$(Computer:TARGET)" -ScanProfile "AD Infos"}

 

Screenshots :

 

 

1

Comments

6 comments
Date Votes
  • HELP .. does not work in my console

    0
  • Hey, sorry i'm not a Powershell expert with knowledge about why. I'm running Set-ADComputer on my Windows 10 Computer with Powershell 5.1. I think it's native on it. Try to "Import-Module ActiveDirectory"

    And tool is running Locally, not remotely. Your admin computer run the command, not the remote computer. To be clear about that :)

    0
  • No PS expert here too.

    Any help, PS experts?

    0
  • Seems to be linked to your RSAT. Module is ready to use when RSAT are installed in windows 8, 8.1 & 10.

    https://4sysops.com/wiki/how-to-install-the-powershell-active-directory-module/

    If not Windows 8 or 10 :

    1. Click Add features, and then:
    2. Select Active Directory module for Windows PowerShell in Remote Server Administration Tools > Role Administration Tools > AD DS and AD LDS Tools.
     
    0
  • Now a bit better .. but not working

    0
  • I remember having already had this error, sometimes, and I don't know the cause. 

    For my part, it never happens twice in a row, it just work properly if I run it a second time.

     

    Maybe a PDQ issue, try the script in Powershell ISE (adapt variables) to test if it works... 
    Maybe just need an additionnal reboot, an additionnal pre-requisite or something like that.. I think I can't help you more about that. :/

    0

Please sign in to leave a comment.

Didn't find what you were looking for?

New post