Jump to content

colombeen

Active Members
  • Posts

    199
  • Joined

  • Last visited

Everything posted by colombeen

  1. Hi guys, I was looking into supporting dark mode for apps in windows 10 and detecting it was fairly easy. There might be other/better ways but this was my approach: Func _AppsUseLightMode() Local $LightMode $LightMode = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize", "AppsUseLightTheme") If @error Then $LightMode = 1 ; If @error is set it probably isn't a win version that supports dark mode If $LightMode = True Then ConsoleWrite("+> Light Mode" & @CRLF) Return True Else ConsoleWrite("!> Dark Mode" & @CRLF) Return False EndIf EndFunc Now when my detection function was fixed I tried to add dark colors to my GUI objects but for some reason I couldn't find a way to fix the light borders around the objects. Has anyone found a fix for this? You can easily add a label with the correct background color as "border color" behind the input field on top (found this somewhere on the forum as well) but this wouldn't be a fix for let's say a listview etc. Any suggestions are welcome. Thanks colombeen
  2. Thank you very much :-)
  3. Hi, I'm having an issue with values that are(n't) returned. for some reason I can't see some of them. Example : This is the result when using powershell : PS C:\> $test = Invoke-Sqlcmd -ServerInstance $Server -Database $DB -Query "SELECT [Naam], [AantalGebruikers], [Suffixes], [Profielen], [Hoofdgebruikers] FROM [TestView] WHERE [Naam] = 'TestCompany'" PS C:\> $test Naam : TestCompany AantalGebruikers : 3 Suffixes : testcompany.com,testcomp.com Profielen : Profile1,Profile4,Profile5,Profile17 Hoofdgebruikers : Doe John,Doe Jane PS C:\> $test.Suffixes testcompany.com,testcomp.com PS C:\> $test.Suffixes.GetType() IsPublic IsSerial Name BaseType -------- -------- ---- -------- True True String System.Object PS C:\> $test.Profielen.GetType() IsPublic IsSerial Name BaseType -------- -------- ---- -------- True True String System.Object When I use the ADO udf to retrieve the same info, then "Suffixes" and "Profielen" are both empty when viewing it with _ArrayDisplay or when using ConsoleWrite. #include "ADO.au3" #include <Array.au3> Local $sDriver = 'SQL Server' Local $sDatabase = 'DB' Local $sServer = 'Server' Local $sUser = '' Local $sPassword = '' _ADO_COMErrorHandler_UserFunction(_ADO_COMErrorHandler) Local $oCon = _ADO_Connection_Create() If IsObj($oCon) Then _ADO_Connection_OpenConString($oCon, 'DRIVER={' & $sDriver & '};SERVER=' & $sServer & ';DATABASE=' & $sDatabase & ';Trusted_Connection=Yes;') If Not @error Then Local $sQuery = "SELECT [Naam], [AantalGebruikers], [Suffixes], [Profielen], [Hoofdgebruikers] FROM [TestView] WHERE [Naam] = 'TestCompany'" Local $aResult = _ADO_Execute($oCon, $sQuery, True) If Not @error Then If IsArray($aResult) Then _ArrayDisplay($aResult[2], "Test Results") EndIf EndIf EndIf EndIf ; $aResults[2] ; ------------- ; [0] : TestCompany ; [1] : 3 ; [2] : ; [3] : ; [4] : Doe John,Doe Jane ; ------------- Any ideas? EDIT: Strange, when I use this it does work: #include "ADO.au3" #include <Array.au3> Local $sDriver = 'SQL Server' Local $sDatabase = 'DB' Local $sServer = 'Server' Local $sUser = '' Local $sPassword = '' _ADO_COMErrorHandler_UserFunction(_ADO_COMErrorHandler) Local $oCon = _ADO_Connection_Create() If IsObj($oCon) Then _ADO_Connection_OpenConString($oCon, 'DRIVER={' & $sDriver & '};SERVER=' & $sServer & ';DATABASE=' & $sDatabase & ';Trusted_Connection=Yes;') If Not @error Then Local $sQuery = "SELECT [Naam], [AantalGebruikers], [Suffixes], [Profielen], [Hoofdgebruikers] FROM [TestView] WHERE [Naam] = 'TestCompany'" Local $aResult = _SQL_FetchData(_ADO_Execute($oCon, $sQuery)) If Not @error Then If IsArray($aResult) Then _ArrayDisplay($aResult, "Test Results") EndIf EndIf EndIf EndIf Why is there a difference when using _ADO_Execute to get an array in comparison to _SQL_FetchData ??
  4. ; Use readable var names ;-) Global $ConversionStatus, $EncryptionPercentage, $EncryptionFlags, $WipingStatus, $WipingPercentage $strComputer = @ComputerName $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $strComputer & "\root\CIMV2\Security\MicrosoftVolumeEncryption") ; $objWMIService error check If @error Then Return False While $EncryptionPercentage <> 100 $objWMIQuery = $objWMIService.ExecQuery("SELECT * FROM Win32_EncryptableVolume WHERE DriveLetter='C:'", "WQL", 0) For $objDrive In $objWMIQuery ; https://docs.microsoft.com/en-us/windows/desktop/secprov/getconversionstatus-win32-encryptablevolume $res = $objDrive.GetConversionStatus($ConversionStatus, $EncryptionPercentage, $EncryptionFlags, $WipingStatus, $WipingPercentage) ; Display Progress Text or increment a Progress Bar ; "Bitlocker Encryption in Progress (" & $EncryptionPercentage & "%)...") Sleep(1000) Next WEnd Nice to see that someone can use it
  5. Found some more bugs, fixed them
  6. Fixed the first bugs I found
  7. Hi everyone, I created a function to gather bitlocker information. It can tell you whether or not a drive is protected, which encryption method is being used, ... I tried to cover all the details in the function description The function (and 3 "internal" functions) : ; #FUNCTION# ==================================================================================================================== ; Name...........: _BitlockerDriveInfo ; Description ...: Get Bitlocker information for one or multiple drives ; Syntax.........: _BitlockerDriveInfo([$sDrive[, $sComputer = @ComputerName[, $bDebug = False]]]) ; Parameters ....: $sDrive - Optional: The drive. Allowed values are: ; |"" - Get the info for all available drives ; |Letter: - Get the info for the specific drive ; $sComputer - Optional: The computer from which the info should be requested ; $bDebug - Optional: Shows the hex ReturnValue from the WMI methods if set to True ; Return values .: Success - Returns a 2D array with the following information ; |[string] Drive Letter ; |[string] Drive Label ; |[string] Volume Type ; |[bool] Initialized For Protection ; |[string] Protection Status ; |[string] Lock Status ; |[bool] Auto Unlock Enabled ; |[bool] Auto Unlock Key Stored ; |[string] Conversion Status ; |[string] Encryption Method ; |[int] Encryption Percentage ; |[string] Wiping Status ; |[int] Wiping Percentage ; |[array] Key Protectors (Or [string] "None" if the drive isn't protected) ; Failure - 0, sets @error to: ; |1 - There was an issue retrieving the COM object. @extended returns error code from ObjGet ; |2 - The specified drive in $Drive doesn't exist ; |3 - There was an issue running the WMI query ; Author ........: colombeen ; Modified.......: ; Remarks .......: Requires to be run with admin elevation. Windows Vista or newer! ; A BIG THANKS to everyone from the community who contributed! ; Related .......: ; Link ..........: ; Example .......: #include <Array.au3> ; $Header = "Drive Letter|Drive Label|Volume Type|Initialized For Protection|Protection Status|" & _ ; "Lock Status|Auto Unlock Enabled|Auto Unlock Key Stored|Conversion Status|Encryption " & _ ; "Method|Encryption Percentage|Wiping Status|Wiping Percentage|Key Protectors" ; _ArrayDisplay(_BitlockerDriveInfo(), "Bitlocker Drive Info", "", 64, Default, $Header) ; =============================================================================================================================== Func _BitlockerDriveInfo($sDrive = "", $sComputer = @ComputerName, $bDebug = False) Local $aConversionStatusMsg[7] = ["Unknown", "Fully Decrypted", "Fully Encrypted", "Encryption In Progress", "Decryption In Progress", "Encryption Paused", "Decryption Paused"] Local $aEncryptionMethodMsg[9] = ["Unknown", "None", "AES_128_WITH_DIFFUSER", "AES_256_WITH_DIFFUSER", "AES_128", "AES_256", "HARDWARE_ENCRYPTION", "XTS_AES_128", "XTS_AES_256"] Local $aKeyProtectorTypeMsg[11] = ["Unknown or other protector type", "Trusted Platform Module (TPM)", "External key", "Numerical password", "TPM And PIN", "TPM And Startup Key", "TPM And PIN And Startup Key", "Public Key", "Passphrase", "TPM Certificate", "CryptoAPI Next Generation (CNG) Protector"] Local $aLockStatusMsg[3] = ["Unknown", "Unlocked", "Locked"] Local $aProtectionStatusMsg[3] = ["Unprotected", "Protected", "Unknown"] Local $aVolumeTypeMsg[3] = ["Operating System Volume", "Fixed Data Volume", "Portable Data Volume"] Local $aWipingStatusMsg[5] = ["Unknown", "Free Space Not Wiped", "Free Space Wiped", "Free Space Wiping In Progress", "Free Space Wiping Paused"] Local $iRow = 0 Local $sRunMethod, $objWMIService, $objWMIQuery, $sDriveFilter, $iProtectionStatus, $iLockStatus, $bIsAutoUnlockEnabled, $bIsAutoUnlockKeyStored, $iConversionStatus, $iEncryptionPercentage, $iEncryptionFlags, $iWipingStatus, $iWipingPercentage, $iEncryptionMethod, $aVolumeKeyProtectorID, $aVolumeKeyProtectors, $iKeyProtectorType $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate,authenticationLevel=pktPrivacy}!\\" & $sComputer & "\root\CIMV2\Security\MicrosoftVolumeEncryption") If @error Then Return SetError(1, @error, 0) If $sDrive <> "" Then Local $iDriveType = _WMIPropertyValue("DriveType", "Win32_LogicalDisk", "WHERE DeviceID='" & $sDrive & "'", Default, $sComputer) If @error Or ($iDriveType <> 2 And $iDriveType <> 3) Then Return SetError(2, 0, 0) $sDriveFilter = " WHERE DriveLetter='" & $sDrive & "'" EndIf $objWMIQuery = $objWMIService.ExecQuery("SELECT * FROM Win32_EncryptableVolume" & $sDriveFilter, "WQL", 0) If Not IsObj($objWMIQuery) Then Return SetError(3, 0, 0) Local $aResult[$objWMIQuery.count][14] For $objDrive In $objWMIQuery If $bDebug Then ConsoleWrite(@CRLF & "+> " & $objDrive.DriveLetter & @CRLF) If _WMIMethodExists($objDrive, "GetConversionStatus") Then $sRunMethod = $objDrive.GetConversionStatus($iConversionStatus, $iEncryptionPercentage, $iEncryptionFlags, $iWipingStatus, $iWipingPercentage) If $bDebug Then ConsoleWrite("!> GetConversionStatus 0x" & Hex($sRunMethod) & @CRLF) Else $iConversionStatus = -1 $iWipingStatus = -1 $iEncryptionPercentage = 0 $iWipingPercentage = 0 EndIf If _WMIMethodExists($objDrive, "GetEncryptionMethod") Then $sRunMethod = $objDrive.GetEncryptionMethod($iEncryptionMethod) If $bDebug Then ConsoleWrite("!> GetEncryptionMethod 0x" & Hex($sRunMethod) & @CRLF) Else $iEncryptionMethod = 0 EndIf If _WMIMethodExists($objDrive, "GetKeyProtectors") Then $sRunMethod = $objDrive.GetKeyProtectors("0", $aVolumeKeyProtectorID) If $bDebug Then ConsoleWrite("!> GetKeyProtectors 0x" & Hex($sRunMethod) & @CRLF) Else $aVolumeKeyProtectorID = 0 EndIf If _WMIMethodExists($objDrive, "GetLockStatus") Then $sRunMethod = $objDrive.GetLockStatus($iLockStatus) If $bDebug Then ConsoleWrite("!> GetLockStatus 0x" & Hex($sRunMethod) & @CRLF) Else $iLockStatus = -1 EndIf If _WMIMethodExists($objDrive, "GetProtectionStatus") Then $sRunMethod = $objDrive.GetProtectionStatus($iProtectionStatus) If $bDebug Then ConsoleWrite("!> GetProtectionStatus 0x" & Hex($sRunMethod) & @CRLF) Else $iProtectionStatus = 2 EndIf If _WMIMethodExists($objDrive, "IsAutoUnlockEnabled") Then $sRunMethod = $objDrive.IsAutoUnlockEnabled($bIsAutoUnlockEnabled) If $bDebug Then ConsoleWrite("!> IsAutoUnlockEnabled 0x" & Hex($sRunMethod) & @CRLF) Else $bIsAutoUnlockEnabled = "Unknown" EndIf If _WMIMethodExists($objDrive, "IsAutoUnlockKeyStored") Then $sRunMethod = $objDrive.IsAutoUnlockKeyStored($bIsAutoUnlockKeyStored) If $bDebug Then ConsoleWrite("!> IsAutoUnlockKeyStored 0x" & Hex($sRunMethod) & @CRLF) Else $bIsAutoUnlockKeyStored = "Unknown" EndIf If IsArray($aVolumeKeyProtectorID) And UBound($aVolumeKeyProtectorID) > 0 Then Dim $aVolumeKeyProtectors[UBound($aVolumeKeyProtectorID)][2] For $i = 0 To UBound($aVolumeKeyProtectorID) - 1 $aVolumeKeyProtectors[$i][0] = $aVolumeKeyProtectorID[$i] If _WMIMethodExists($objDrive, "GetKeyProtectorType") Then If $objDrive.GetKeyProtectorType($aVolumeKeyProtectorID[$i], $iKeyProtectorType) = 0 Then $aVolumeKeyProtectors[$i][1]= $aKeyProtectorTypeMsg[$iKeyProtectorType] Else $aVolumeKeyProtectors[$i][1]= "Unknown" EndIf Else $aVolumeKeyProtectors[$i][1] = "Unknown" EndIf Next Else $aVolumeKeyProtectors = "None" EndIf ; DriveLetter $aResult[$iRow][0] = $objDrive.DriveLetter ; DriveLabel $aResult[$iRow][1] = _WMIPropertyValue("VolumeName", "Win32_LogicalDisk", "WHERE DeviceID='" & $objDrive.DriveLetter & "'", Default, $sComputer) ; VolumeType If _WMIPropertyExists($objDrive, "VolumeType") Then $aResult[$iRow][2] = $aVolumeTypeMsg[$objDrive.VolumeType] Else If $objDrive.DriveLetter = _WMIPropertyValue("SystemDrive", "Win32_OperatingSystem", "", Default, $sComputer) Then $aResult[$iRow][2]= $aVolumeTypeMsg[0] ElseIf _WMIPropertyValue("DriveType", "Win32_LogicalDisk", "WHERE DeviceID='" & $objDrive.DriveLetter & "'", Default, $sComputer) = 3 Then $aResult[$iRow][2]= $aVolumeTypeMsg[1] ElseIf _WMIPropertyValue("DriveType", "Win32_LogicalDisk", "WHERE DeviceID='" & $objDrive.DriveLetter & "'", Default, $sComputer) = 2 Then $aResult[$iRow][2]= $aVolumeTypeMsg[2] Else $aResult[$iRow][2]= "Unknown" EndIf EndIf ; IsVolumeInitializedForProtection If _WMIPropertyExists($objDrive, "IsVolumeInitializedForProtection") Then $aResult[$iRow][3] = $objDrive.IsVolumeInitializedForProtection Else $aResult[$iRow][3] = "Unkown" EndIf ; ProtectionStatus $aResult[$iRow][4] = $aProtectionStatusMsg[$iProtectionStatus] ; LockStatus $aResult[$iRow][5] = $aLockStatusMsg[$iLockStatus + 1] ; IsAutoUnlockEnabled $aResult[$iRow][6] = $bIsAutoUnlockEnabled ; IsAutoUnlockEnabled $aResult[$iRow][7] = $bIsAutoUnlockKeyStored ; ConversionStatus $aResult[$iRow][8] = $aConversionStatusMsg[$iConversionStatus + 1] ; EncryptionMethod $aResult[$iRow][9] = $aEncryptionMethodMsg[$iEncryptionMethod + 1] ; EncryptionPercentage $aResult[$iRow][10] = $iEncryptionPercentage ; WipingStatus $aResult[$iRow][11] = $aWipingStatusMsg[$iWipingStatus + 1] ; WipingPercentage $aResult[$iRow][12] = $iWipingPercentage ; KeyProtectors $aResult[$iRow][13] = $aVolumeKeyProtectors $iRow += 1 Next _ArraySort($aResult) Return $aResult EndFunc ;==>_BitlockerDriveInfo Func _WMIPropertyExists($Object, $Property) If Not IsObj($Object) Then Return False For $sProperty In $Object.Properties_ If $sProperty.Name = $Property Then Return True Next Return False EndFunc ;==>_WMIPropertyExists Func _WMIMethodExists($Object, $Method) If Not IsObj($Object) Then Return False For $sMethod In $Object.Methods_ If $sMethod.Name = $Method Then Return True Next Return False EndFunc ;==>_WMIMethodExists Func _WMIPropertyValue($sProperty = "", $sClass = "", $sFilter = "", $sNamespace = Default, $sComputer = @ComputerName) Local $objWMIService, $objWMIQuery If $sClass = "" Or $sProperty = "" Then Return SetError(1, 0, 0) If $sFilter <> "" Then $sFilter = " " & $sFilter If $sNamespace = Default Then $sNamespace = "\root\CIMV2" $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate,authenticationLevel=pktPrivacy}!\\" & $sComputer & $sNamespace) If @error Then Return SetError(2, @error, 0) $objWMIQuery = $objWMIService.ExecQuery("SELECT * FROM " & $sClass & $sFilter, "WQL", 0x30) If Not IsObj($objWMIQuery) Then Return SetError(3, 0, 0) For $objItem In $objWMIQuery For $Property In $objItem.Properties_ If $Property.Name = $sProperty Then Return $Property.Value EndIf Next Next Return SetError(4, 0, 0) EndFunc ;==>_WMIPropertyValue Example 1: #RequireAdmin #include <array.au3> ; Get information on all available drives Global $test = _BitlockerDriveInfo() If @error Then ConsoleWrite("!> _BitlockerDriveInfo() error: " & @error & ". extended: " & @extended & @CRLF) ElseIf IsArray($test) Then _ArrayDisplay($test, "Bitlocker Drive Info", "", 64, Default, "Drive Letter|Drive Label|Volume Type|Initialized For Protection|Protection Status|Lock Status|Auto Unlock Enabled|Auto Unlock Key Stored|Conversion Status|Encryption Method|Encryption Percentage|Wiping Status|Wiping Percentage|Key Protectors") ; Display the Key Protectors for the first record If IsArray($test[0][13]) Then _ArrayDisplay($test[0][13]) EndIf Example 2: #RequireAdmin #include <array.au3> ; Get information on the C-drive of the current computer + show extra information in the console Global $test = _BitlockerDriveInfo("C:", @ComputerName, True) If @error Then ConsoleWrite("!> _BitlockerDriveInfo() error: " & @error & ". extended: " & @extended & @CRLF) ElseIf IsArray($test) Then ConsoleWrite("Bitlocker information on the " & $test[0][0] & " drive" & @CRLF) ConsoleWrite("Protection Status: " & $test[0][4] & @CRLF) EndIf Screenshot for the first example: Suggestions? Bugs? Just let me know TODO: ??? Version 1.0: Initial release Version 1.1: Fixed: Drive Label will not work when you request the information from a remote system (currently using DriveGetLabel) Fixed: The current fix for the missing VolumeType property in some Windows versions will only work locally Added: New internal function (_WMIPropertyValue()) Version 1.2: Fixed: The drive exists & drive type check only worked locally when a drive was specified in $sDrive
  8. Is it that simple? I'll try that out! Thx! EDIT: Just tried it, WORKS LIKE A CHARM! I moved the script to the examples :
  9. Anyone who can help me fix this?
  10. I'm just having one last issue before I can post the "final" version in the example scripts I need to add #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 But the changes I need to make so that my script will still work is what I can't figure out. This is the part that will show errors : If IsArray($aVolumeKeyProtectorID) And UBound($aVolumeKeyProtectorID) > 0 Then Local $aVolumeKeyProtectors[UBound($aVolumeKeyProtectorID)][2], $iKeyProtectorType For $i = 0 To UBound($aVolumeKeyProtectorID) - 1 $aVolumeKeyProtectors[$i][0] = $aVolumeKeyProtectorID[$i] If _WMIMethodExists($objDrive, "GetKeyProtectorType") Then If $objDrive.GetKeyProtectorType($aVolumeKeyProtectorID[$i], $iKeyProtectorType) = 0 Then $aVolumeKeyProtectors[$i][1]= $aKeyProtectorTypeMsg[$iKeyProtectorType] Else $aVolumeKeyProtectors[$i][1]= "Unknown" EndIf Else $aVolumeKeyProtectors[$i][1] = "Unknown" EndIf Next Else Local $aVolumeKeyProtectors = "None" EndIf I declare the $aVolumeKeyProtectors 2 times, which I know is wrong, even more so when you put it inside of a loop. Any suggestions? I can't seem to figure it out
  11. Awesome! I'll still need to fix some things but I'm getting there EDIT: I've added a few checks to make sure everything works fine, I'm not noticing alot of performance loss. ; newer version in latest post
  12. ; newer version in latest post This is an attempt to fix the missing properties in Win7
  13. I've made some more changes. I'm hoping it will work (can't test it here, I'm not allowed to encrypt my system just yet). If anyone is willing to test my script (doens't matter if your system is or isn't using bitlocker, you just need WinVista or newer), please let me know what the result was so that I can fix bugs etc before I implement it (and also share it here ofcourse) Please run SciTE as admin, otherwise you won't see the errors etc in the console ; newer version in latest post Also, I'm not sure if it's possible to read this information remotely because of safety precautions by MS. This is my result : My console output : !> GetConversionStatus 0x00000000 !> GetEncryptionMethod 0x00000000 !> GetKeyProtectors 0x00000000 !> GetLockStatus 0x00000000 !> GetProtectionStatus 0x00000000 !> IsAutoUnlockEnabled 0x80310008 !> IsAutoUnlockKeyStored 0x80310008 EDIT: I had a little issue that the secondary pop-up didn't show because I forgot to change $test[0][11] to $test[0][12] when I added another item to the array.
  14. I was coming to the same conclusion as well on the -1 being UNKNOWN in most cases. I've added it to my array as the first item and just +1 the result I get for now ; newer version in latest post If anyone who is using bitlocker could test this out (and post back the results), it would be greatly appreciated!
  15. YOU ARE A LIFE SAVER But I'm still not sure what to do with the -1 I'm getting from the $intWipingStatus :-s
  16. Guessing it's not a very popular subject. Another thing that frustrates me is the return value of the "IsAutoUnlockKeyStored"-method (I'm not talking about the out param, just the return value). The documentation shows uint32 IsAutoUnlockKeyStored( [out] boolean IsAutoUnlockKeyStored ); And the return values should be Return code/value Description --------------------------------------------------- S_OK The method was successful. 0 (0x0) FVE_E_NOT_ACTIVATED BitLocker is not enabled on the volume. Add a key protector to enable BitLocker. 2150694920 (0x80310008) FVE_E_NOT_OS_VOLUME The method can only be run for the currently running operating system volume. 2150694952 (0x80310028) But then why do I keep getting "-2144272376" Is there some kind of conversion I'm forgetting or is MS just screwing me over?
  17. Mhhmmnn... Some of the values that I get back aren't what I'm expecting. I'll just show you guys what I'm working on (FYI: it's far from ready, but the end result will be shared) : ; newer version in latest post When I run this the $intWipingStatus contains "-1", but in powershell I get this value "4294967295", while the documentation shows that it could only be an int between 0 and 3 https://docs.microsoft.com/en-us/windows/desktop/secprov/getconversionstatus-win32-encryptablevolume Any idea?
  18. Hi guys, I'm trying to get some information using WMI, from the Win32_EncryptableVolume class. I exec my query, filter out the C-drive, but when I need more info using the objects methods, I only get 1 value back and I can't seem to retrieve the other out params that should be there. A very minimal version of what I'm trying to do (no error checking etc, very basic). You need to start SciTE as admin or you won't see any results in the console! #RequireAdmin $strComputer = @ComputerName $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $strComputer & "\root\CIMV2\Security\MicrosoftVolumeEncryption") $objWMIQuery = $objWMIService.ExecQuery("SELECT * FROM Win32_EncryptableVolume WHERE DriveLetter='C:'", "WQL", 0) For $objDrive In $objWMIQuery ConsoleWrite("> " & $objDrive.GetConversionStatus() & @CRLF) ConsoleWrite("> " & $objDrive.GetConversionStatus().ConversionStatus & @CRLF) ConsoleWrite("> " & $objDrive.GetConversionStatus().EncryptionPercentage & @CRLF) Next The result from the console is : > 0 > > What I'm expecting to get back is : > 0 > 0 > 0 When using powershell I get this (run as admin is required!!!) : PS C:\WINDOWS\system32> (Get-WmiObject -namespace "Root\cimv2\security\MicrosoftVolumeEncryption" -ClassName "Win32_Encryptablevolume" -Filter "DriveLetter='C:'").GetConversionStatus() ... ConversionStatus : 0 EncryptionFlags : 0 EncryptionPercentage : 0 ReturnValue : 0 ... All I seem to be getting is the ReturnValue when I use the method. I've tried this on multiple methods, always ending up with the same result Anyone here who has experience with this type of thing? Greetz colombeen
  19. Because it didn't show up in my search results :-) This is working perfectly! So true! We manage over 20000 devices and timestamps + timezones are pretty important.
  20. holy cr*p that's alot of lines for something i expected to see natively in autoit for date/time conversion. I'll try it out
  21. Not exactly what i'm looking for... I want to convert this to : LocalDateTime : 13/08/2018 17:39:23 and not just take the time from the string.
  22. Hi everyone I've been looking around for a way to convert this date/time format to a normal, readable format : 2018-08-13T16:39:23+01:00 But for some reason I can't seem to find a solution. I've been looking on google, the forum, ... but I'm either using the wrong search terms or there aren't any posts on this specific type of date/time format? Anyone who can help? This date/time format something that Active Directory returned when querying bitlocker recovery information. Greetz Colombeen --- In powershell you can do this : PS H:\> [System.DateTimeOffset] "2018-08-13T16:39:23+01:00" DateTime : 13/08/2018 16:39:23 UtcDateTime : 13/08/2018 15:39:23 LocalDateTime : 13/08/2018 17:39:23 Date : 13/08/2018 0:00:00 Day : 13 DayOfWeek : Monday DayOfYear : 225 Hour : 16 Millisecond : 0 Minute : 39 Month : 8 Offset : 01:00:00 Second : 23 Ticks : 636697751630000000 UtcTicks : 636697715630000000 TimeOfDay : 16:39:23 Year : 2018
  23. Hi guys, I'm having this issue : I'm running an autoit application with alternate credentials. I have a button inside that app that launches a browser window with a specific url, but since the autoit app is started with other credentials, the app doesn't start my current logged on users default browser. It starts an IE window with the alternate credentials. Is there a way to ignore the alternate credentials (but i do need these to start the autoit app) and start the url with the currently loggend on user? Greetz Colombeen
×
×
  • Create New...