
How to do ‘replaceall’ in VBScript?
As you might know the vbscript replace function does always search only "one round". Here is an example, what exactly I mean: Lets assume you want to correct the following string by replacing all "double-l's" by "single-l's": str = "Littllllle worllllllld!" The code...
How to access WMI namespaces on remote computers that require encryption?
When you have a look at my vbscript bitlocker post and try to use it on remote machines you may not get any results but an application eventlog entry similar to this one here: Event Source: WinMgmt Event ID: 5605 Access to the [...] namespace was denied. The namespace...
How to use environment variables in Powershell?
Sometimes you need to use an environment variable (eg. username, userprofile, computername, ...) in Powershell. The location where environment variables are stored is "env:". This behaves similar to a hard or flash drive. You can list its content or browse it by using...
How to display active connections and running queries in SQL Server?
This query shows all queries executed at the moment, the session id, status, used cpu time and the execution duration SELECT st.text, r.session_id, r.status, r.command, r.cpu_time, r.total_elapsed_time FROM sys.dm_exec_requests r CROSS APPLY...
How to read and use the contents of a website from Powershell?
First we need to create a xmlhttp object, similar to what you would do in JavaScript $objXmlHttp = New-Object -ComObject MSXML2.ServerXMLHTTP Use the open method to specify the url, optional username and password. The third parameter (optional) is a boolean indicator...
How to connect to / read from / write to SQL Server from Powershell?
First create the connection object, set the connection string and open the connection: $objSqlConnection = New-Object System.Data.SqlClient.SqlConnection $objSqlConnection.ConnectionString = "Server=YourSqlServer; Database=YourDataBase; User Id=YourUsername;...
How to get some information on Bitlocker using VBScript and WMI?
Documentation for functions, methods and properties used in this post: Win32_EncryptableVolume GetEncryptionMethod GetProtectionStatus GetConversionStatus GetKeyProtectors GetLockStatus GetKeyProtectorFriendlyName
Recent Comments