Chirag Nagrekar has Published 465 Articles

How to get the Shared folder permissions with PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 01-Mar-2021 10:47:51

19K+ Views

To get the shared folder permissions using PowerShell, we can use the Get-SmbShare cmdlet.For example, we have a shared folder name DSC and we need to retrieve its permissions, we can use the below command.CommandGet-SmbShare -Name DSCOutputName ScopeName Path Description ---- --------- ---- ----------- DSC       *   E:\DSCIt doesn’t ... Read More

How to change SMB shared folder access permission using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 01-Mar-2021 10:46:23

5K+ Views

We can use the command Grant-SmbShareAccess to change the shared folder access permission or to assign the new user to the shared folder with permission.In this example, we have already shared a folder name called “Shared Folder” and everyone's user permission is assigned with the read access and we will change ... Read More

How to share a windows folder using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 01-Mar-2021 10:45:13

10K+ Views

To share a windows folder using PowerShell, we can use the New-SmbShare command. This command is a part of the module SmbShare.In this example, we have a folder called “DSC” and we want to share. The below command will simply share folderNew-SmbShare -Path E:\DSC\ -Name "Shared Folder"OutputName       ... Read More

How to remove windows folder sharing using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 01-Mar-2021 10:09:16

2K+ Views

To remove the windows folder sharing using PowerShell, we can use the Remove-Smbshare command. For example, PS C:\Temp> Remove-SmbShare -Name DSC Confirm Are you sure you want to perform this action? Performing operation 'Remove-Share' on Target '*, DSC'. [Y] Yes [A] Yes to All [N] No [L] No to All ... Read More

How to delete the specific node from the XML file using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 01-Mar-2021 09:59:35

8K+ Views

To delete the specific XML node from the PowerShell, we can use the RemoveChild() method of the XML.For example, We have a sample XML file from Microsoft.https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms762271(v=vs.85)We have saved the above file into C:\Temp\SampleXml.XML and we need to delete the book node with attribute ‘bk102’ and for that, we will ... Read More

How to add an attribute to the XML file using Powershell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 01-Mar-2021 09:56:31

6K+ Views

To add the attribute to the XML, we first need to add the Element and then we will add an attribute for it.Below is a sample of the XML file.Example           Gambardella, Matthew       XML Developer's Guide       Computer     ... Read More

How to add a new element in the XML using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 19-Feb-2021 13:18:54

8K+ Views

Suppose we have a XML file as shown below.           Gambardella, Matthew       XML Developer's Guide       Computer       44.95       2000-10-01       An in-depth look at creating applications with XML.     We need ... Read More

How to run Invoke-Command in PowerShell Workflow?

Chirag Nagrekar

Chirag Nagrekar

Updated on 19-Feb-2021 13:15:55

1K+ Views

To run Invoke-Command in PowerShell Workflow we need to use the InlineScript block because Invoke-Command is not supported directly in the workflow. The below example is without using the InlineScript block we get an error.ExampleWorkflow TestInvokeCommand{    Invoke-Command -ComputerName LabMachine2k16 -ScriptBlock{       Get-Service WINRM    } }Output −At ... Read More

How to remove Windows service with PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 19-Feb-2021 13:13:54

5K+ Views

We need to remove the window service named TestService using PowerShell. If you are using PowerShell 6.0 or above version, you can directly use a cmdlet Remove-Service command as shown below.In this example, we have a service name called TestService.Remove-Service Testservice -Confirm:$false -VerboseIf you are using the PowerShell framework version ... Read More

How Parallel and Sequence execution works in PowerShell Workflow?

Chirag Nagrekar

Chirag Nagrekar

Updated on 19-Feb-2021 13:08:19

1K+ Views

PowerShell workflows are the best way to design the script to execute on more than one node parallel which saves extensive time for the output to produce but we always don’t want to run all the commands parallel but also need some of them to run sequentially and we can ... Read More

Advertisements