Jump to content

LDAP and Setting a UUID


SmOke_N
 Share

Recommended Posts

  • Moderators

I am using COM to find the UUID of a computer:

Func _GetUUID()
    Local $colItems, $objWMIService, $objItem, $sObjReturn = ''
    $objWMIService = ObjGet("winmgmts:\\" & @ComputerName & "\root\CIMV2")
    $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystemProduct", "WQL", 0x10 + 0x20)
    If IsObj($colItems) Then
        For $objItem In $colItems
            $sObjReturn = $objItem.UUID
            If $sObjReturn Then ExitLoop
        Next
        If $sObjReturn Then
            If ($sObjReturn <> "00000000-0000-0000-0000-000000000000") And _
                ($sObjReturn <> "FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF") And _
                ($sObjReturn <> "11111111-1111-1111-1111-111111111111") Then 
                Return $sObjReturn
            EndIf
        EndIf
    EndIf
    Return _GetMacUUID()
EndFuncoÝ÷ Ù*&zئzËajÚÞ²ém­ën®{I©·*+6ée²Úâ   èµç[ÊØ^7êíº¹Óé쵫^éíiº/y*-éÈjÛ^m¢ë¶&v·¬±«,¡«­¢+Ø)Õ¹}Ñ5UU% ¤(%1½°ÀÌØí½±%ѵ̰ÀÌØí½©]5%MÉÙ¥°ÀÌØí½©%Ñ´($ÀÌØí½©]5%MÉÙ¥ô=©Ð ÅÕ½ÐíÝ¥¹µµÑÌèÀäÈìÀäÈìÅÕ½ÐìµÀì
½µÁÕÑÉ9µµÀìÅÕ½ÐìÀäÈíɽ½ÐÀäÈí
%5XÈÅÕ½Ðì¤($ÀÌØí½±%ѵÌôÀÌØí½©]5%MÉÙ¥¹%¹ÍѹÍ= ÅÕ½Ðí]¥¸ÌÉ}9ÑݽɭÁÑÈÅÕ½Ðì¤(%%%Í=¨ ÀÌØí½±%ѵ̤Q¡¸($%½ÈÀÌØí½©%Ñ´%¸ÀÌØí½±%ѵÌ($$%%ÀÌØí½©%Ñ´¹9µôÌäíA­ÐM¡Õ±È5¥¹¥Á½ÉÐÌäìQ¡¸IÑÕɸÅÕ½ÐìÀÀÀÀÀÀÀÀ´ÀÀÀÀ´ÀÀÀÀ´ÀÀÀÀ´ÅÕ½ÐìµÀìMÑÉ¥¹IÁ± ÀÌØí½©%Ñ´¹5
ÉÍÌ°ÌäìèÌäì°ÌäìÌäì¤($%9áÐ(%¹%(%á¥Ð)¹Õ¹oÝ÷ Ù8b³
+Çâæ¬àjËaz·¢±£    §]­ë,-z·ZÈÚ)í£h§²Ö§që0êÞ¶PëzÛ«çZ6ée¢±&¦Ü¬¶¸§©Ý¶«{¬ §]­ë,Méex&zj+zØZX¤z¢·lm觶§v¯»njW§¾*èg§´Ú0æjYr#
.Øî²ØêÚµæPÚÚeiÇ¢¶)íêÞ+-¯&î·Y'£ajجm§Ú¡©òø­Ç%¢wJazr,zÚ.¶ÚwZÁ¬­«b~Ø^QBÁ«
ºYZÚ+jmɩݶ&v·¬³¬6ÞÆ+-z{m¡§]iEÚ-ç.®·§µÊ&¦ë^®Ë-jwZ­Õ 6«y¦Ú²ÏÛºh§Øb³
.Ù÷öØn®Ö§ÊØb"Ç¢µØm{¬¶Úz§Â+ajwH~§vz-)à¶é¶§Ø}êÞÙriº.¶+H~§vØb±Ê{Gz·¢±©ÞÅ©©êºÈ§Ø^´Zè+kxºw-í¢Ç­ßÙÞµº(´e
«m®&îµê'jw±Ëb(­zºç-ßÖ(¹Æ§j[(±ëgzÖè¢Ñ 6­¶­æ­íg¨~Ø^r©º×«¡¸ÞrÓëö­x7ªÞéܶ*'´Zè+kx½ø¢W·ÙÙeß4%ZZlÌúèÀ°º'HÀ°­{@°º'ú⽫^JæÅ¢¹¡§xÓCj¢j@°°8¦­ëojP,.à)¬¶± 0,JÚââ >4Ñ:5ç@°­zËkB

Not understanding LDAP is probably my biggest fault (because I'm sure I could have fumbled across a mistake that worked by now), I'm still unsure if this is even a route I should be taking, I don't know if the end-user has to be set up on a network, which after reading the parameters, I'm starting to think I may be barking up the wrong tree all together.

So if anyone can help with the translation, or knows of an easier or a more efficient way, I'm open to suggestions.... Thanks.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

So if anyone can help with the translation, or knows of an easier or a more efficient way, I'm open to suggestions.... Thanks.

what are you trying to do? Based on the code you've provided I'm not quite sure ...

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

  • Moderators

what are you trying to do? Based on the code you've provided I'm not quite sure ...

Cheers

Kurt

During the registration process or the starting of the application if it's already been registered. It checks for the UUID of the computer it is on. It then writes that UUID (encrypted) and compares every start up along with the registration authenticating.

On some computers, the UUID is returned NULL or Empty. So then I go for the next best thing, the MAC.

Now the above worked fine for verifying that it was only used on the computer it was originally registered too until yesterday.

I received 2 Null strings and No MAC.

I need a way to set a GUID to the UUID location if it is NULL or Empty, so that I don't get a failed attempt from an Empty/Null UUID and a Empty MAC address.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

You know that I know that You know that I know that You know that I know that

You know that I know that You know that I know that You know that I know that

... this is out of my league

but gafrost made one, its in Autoit Wrappers ( where i put all your stuff too )

http://www.autoitscript.com/forum/index.ph...st&p=199602

hope it helps

8)

That generates the GUID, I need to set it, I can't have it generate at every startup, it should only be once. ;)

Edit:

Better clarification

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I need a way to set a GUID to the UUID location if it is NULL or Empty, so that I don't get a failed attempt from an Empty/Null UUID and a Empty MAC address.

Ah, O.K. But then you will need something different than LDAP, as an LDAP service is only available if there is a Domain (and a domain controller). There is no LDAP service on a single WinXP box.... Maybe google has an answer. Let's see ....

I'll be back ( I always wanted to say that ;) )

EDIT: to be totally sure. You want a secure method to identify a computer, so your installation/start-up routine can check if your software has already been registered?

Cheers

Kurt

Edited by /dev/null

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

  • Moderators

Ah, O.K. But then you will need something different than LDAP, as an LDAP service is only available if there is a Domain (and a domain controller). There is no LDAP service on a single WinXP box.... Maybe google has an answer. Let's see ....

I'll be back ( I always wanted to say that ;) )

I'll call you Arnold from now on rather than Kurt :lmao:

EDIT: to be totally sure. You want a secure method to identify a computer, so your installation/start-up routine can check if your software has already been registered?

Cheers

Kurt

Not just already "registered" to, but also verify that is only on the same computer it was "originally" registered to.

Something that won't be the same if cloned like the UUID is not the same when cloned.

Thanks for your time Arnold :evil:

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I'll call you Arnold from now on rather than Kurt ;)

Not just already "registered" to, but also verify that is only on the same computer it was "originally" registered to.

Something that won't be the same if cloned like the UUID is not the same when cloned.

Thanks for your time Arnold :lmao:

are you REALLY sure that a UUID is not the same when a system was cloned (with GHOST or Acronis)???

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

  • Moderators

are you REALLY sure that a UUID is not the same when a system was cloned (with GHOST or Acronis)???

Cheers

Kurt

Nope, I'm fairly sure it's created by the virtual environment itself.. I'm just trying to cover all bases (preventative maintenance).

Edit:

Ebonics.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...