Sign in to follow this  
Followers 0
rudi

Active Directory: Get the Computer Account Name of *THIS* PC

4 posts in this topic

Hi.

is there an easy way to retrieve the SAM account name of the computer account of *THIS* PC?

Regards, Rudi.


Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites



Hallo Rudi,

usually the SAM Account name of the computer running a script is: @ComputerName & "$"


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Hi Water,

thanks for your reply.

Yes, I know that this *SHOULD* be the computer account associated with *THIS* computer. Is there an option to *VERIFY*, that this is fact?

For rollout tasks I want to use a script to check congruence of HW TAG ID, @Computername, DNS Hostname, AD-PC-Account-Name.

as I'm more familiar with Autoit than with PowerShell, I want to solve the task with autoit

Regards, Rudi.

Note to myself - PowerShell: (gwmi win32_systemenclosure).SMBIOSAssetTag


Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites

You could use my Active Directory UDF (for download please check my signature).

To check if the object @ComputerName & "$" exists use function _AD_ObjectExists.

To search for a specific property use _AD_GetObjectsInOU.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0