Software & Coding Articles

Page 53 of 83

How to remove connected remote desktop user sessions using PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 15-Dec-2020 4K+ Views

We can remove connected RDP sessions using PowerShell and for that, we can use the cmd command “reset session” in PowerShell.  Let’s see the supported parameters for it.ExamplePS C:\> reset session /? Reset the session subsytem hardware and software to known initial values. RESET SESSION {sessionname | sessionid} [/SERVER:servername] [/V] sessionname         Identifies the session with name sessionname. sessionid           Identifies the session with ID sessionid. /SERVER:servername  The server containing the session (default is current). /V                  Display additional information.We can provide here session ...

Read More

How to get connected remote desktop users on computers using PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 15-Dec-2020 3K+ Views

To get the user sessions on the remote computers using PowerShell, we need to use the cmd query command. First of all, we will get the user sessions on the local computer using the below command.Examplequery sessionOutputLet’s see what are other supported parameters for the query session command.ExamplePS C:\> query session /? Display information about Remote Desktop Services sessions. QUERY SESSION [sessionname | username | sessionid]               [/SERVER:servername] [/MODE] [/FLOW] [/CONNECT] [/COUNTER] [/VM] sessionname         Identifies the session named sessionname. username            Identifies the session ...

Read More

How to convert Dictionary to Hashtable in PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 15-Dec-2020 1K+ Views

Like any other data type conversion in PowerShell, we can convert Dictionary to hashtable in a similar way.  We have a below Dictionary for the example called $CityData.Key     Value ---     ----- India      91 Austria    43Its datatype is Dictionary,ExamplePS C:\> $citydata.GetType() | ft -AutoSizeOutputIsPublic IsSerial Name         BaseType -------- -------- ----         -------- True     True     Dictionary`2 System.ObjectTo convert it to the hashtable,$hash = [Hashtable]$citydataOr$hash = [System.Collections.Hashtable]$CityDataDatatype:PS C:\> $hash | ft -AutoSizeOutputName    Value ----    ----- Austria 43 India   91

Read More

What is the difference between Dictionary and HashTable in PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 15-Dec-2020 2K+ Views

PowerShell programmers generally prefer the Hashtable over the Dictionary although there are some advantages of using Dictionary. See the difference below.a. Hashtable is easy to declare while the Dictionary is a little complex compared to Hashtable. For example, To create a hashtable, $hash = @{    'Country' = 'India'    'Code' = '91' }To create a Dictionary, $citydata = New-Object System.Collections.Generic.Dictionary"[String, Int]" $citydata.Add('India', 91) b. Hashtable is included in the namespace called Collections while Dictionary is included in the namespace called System.Collections.Generic namespace. Hashtable is non-generic so it can be a collection of different data types and Dictionary belongs to a generic class so it is ...

Read More

How to create a Dictionary in PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 15-Dec-2020 13K+ Views

To create a dictionary in the PowerShell we need to use the class Dictionary from the .Net namespace System.Collections.Generic. It has TKey and TValue. Its basic syntax isDictionaryTo learn more about this .Net namespace check the link below.https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2?view=net-5.0To create a dictionary we will first create the object for the dictionary object class with the datatypes. In the below example, we need to add the Country name and the country code. So we need String and Int.$countrydata = New-Object System.Collections.Generic.Dictionary"[String, Int]"Once we check the type of the $countrydata variable, it should be the dictionary. For example, ExamplePS C:\> $Countrydata.GetType() | ft -AutoSizeOutputIsPublic ...

Read More

How to convert JSON file to CSV file using PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 15-Dec-2020 24K+ Views

To convert the JSON file to the CSV file using PowerShell, we need to use the ConvertTo-CSV command as a pipeline.For example, we have a JSON file called PatchingServer.JSON stored at C:\temp and its content is as below.ExamplePS C:\> Get-Content C:\Temp\PatchingServer.json {    "Port": "9000",    "ApplicationName": "TestApp",    "MaintenanceWindow": "Every Saturday",    "BusinessUnit": "IT",    "AppOwner": "Josh",    "AppID": "1jj2221-223443s",    "Location": "EastUS" }We need to convert the above file to the CSV file so we will use the ConvertTo-CSV command but before that, we need the JSON file need to be converted from JSON format to table format using ...

Read More

How to find Windows Product Key Using PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 15-Dec-2020 4K+ Views

Windows Product key can be retrieved using PowerShell or CMD. To retrieve the product key using PowerShell, we need to query SoftwareLicesingService class and there is a property called OA3xOriginalProductKey which stores the product key.ExampleGet-WmiObject -query `select * from SoftwareLicensingService' | Select OA3xOriginalProductKeyOutputOA3xOriginalProductKey ---------------------- BBBBB-CSDSC-EESSR-KKIDS-AAAAAWe can also query this WMI class using cmd as shown below.wmic path softwarelicensingservice get OA3xOriginalProductKeyCaution: It may or may not work for all the Windows OS. The above is tested in Windows 10.

Read More

How to find a Computer product serial number using PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 15-Dec-2020 5K+ Views

Generally, Product serial numbers are available at the back of the laptop on the company sticker and we can use the Third-party or manufacturer software to find the Product details. The product serial number can also be found using the BIOS utility or command. We can either use the BIOS command for the cmd or using PowerShell.To get the product serial number using PowerShell, we can use WMI or CIMInstance command. For example, ExampleGet-CimInstance Win32_BIOSWe can also use the WMI command. For example, ExampleGet-WmiObject Win32_BIOSOutputSMBIOSBIOSVersion : F.13 Manufacturer      : AMI Name              : ...

Read More

What are the different kinds of gradient descent algorithms in Machine Learning?

AmitDiwan
AmitDiwan
Updated on 11-Dec-2020 905 Views

The idea behind using gradient descent is to minimize the loss when in various machine learning algorithms. Mathematically speaking, the local minimum of a function is obtained.To implement this, a set of parameters are defined, and they need to be minimized. Once the parameters are assigned coefficients, the error or loss is calculated. Next, the weights are updated to ensure that the error is minimized. Instead of parameters, weak learners can be users, such as decision trees.Once the loss is calculated, gradient descent is performed, and tree is added to the algorithm step wise, so that loss is minimal.Some examples ...

Read More

How can Deep Learning be used for facial recognition in Machine Learning?

AmitDiwan
AmitDiwan
Updated on 11-Dec-2020 345 Views

Face recognition is the task of identifying and verifying people present in a photograph based on their face. This is a trivial task for humans, even if the lights are varying or when faces change due to age or they are obstructed with accessories, facial hair and so on.But it remained a fairly challenging computer vision problem until a few years back. Deep learning methods have been able to leverage large datasets of faces and learn various representations of faces, thereby allowing modern learning models to perform well and better.Facial recognition may be used to identify person in a photograph ...

Read More
Showing 521–530 of 825 articles
« Prev 1 51 52 53 54 55 83 Next »
Advertisements