rudi Posted April 2, 2012 Posted April 2, 2012 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!
water Posted April 2, 2012 Posted April 2, 2012 Hallo Rudi, usually the SAM Account name of the computer running a script is: @ComputerName & "$" My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
rudi Posted April 2, 2012 Author Posted April 2, 2012 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!
water Posted April 2, 2012 Posted April 2, 2012 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 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now