rudi Posted April 2, 2012 Share 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! Link to comment Share on other sites More sharing options...
water Posted April 2, 2012 Share 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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
rudi Posted April 2, 2012 Author Share 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! Link to comment Share on other sites More sharing options...
water Posted April 2, 2012 Share 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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
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