PowerShell for Windows Admins:

PowerShell


May 23, 2014  1:46 AM

Remove entry from trusted hosts list

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
PowerShell

The last variant I want to show is removing a single entry from the list function remove-trustedhost { [CmdletBinding()] param ( [string]$trustedhost, [string]$computername = $env:COMPUTERNAME ) if (Test-Connection -ComputerName $computername -Quiet -Count 1) { $th = Get-WSManInstance...

May 22, 2014  11:39 AM

Clearing the trusted hosts list

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
PowerShell

Sometimes you may just need to clear out all of the current values in the trusted hosts list and start again – especially in a lab environment where you may be experimenting. function clear-trustedhost { [CmdletBinding()] param ( [string]$computername = $env:COMPUTERNAME ) if...


May 22, 2014  10:40 AM

Adding to the trusted hosts list

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
PowerShell

Its OK to be able to read the contents of the trusted hosts list but what about adding values to it? function add-trustedhost { [CmdletBinding()] param ( [string]$trustedhost, [string]$computername = $env:COMPUTERNAME ) if (Test-Connection -ComputerName $computername -Quiet -Count 1)...


May 20, 2014  1:21 PM

Reading the trusted hosts list

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
PowerShell

One of the sessions I did at the recent PowerShell summit was on using the WSMAN cmdlets. In my experience, these cmdlets aren’t used much. This is for a couple of reasons I think – the syntax is a bit difficult and there are often other ways to perform the task. This short series of posts...


May 19, 2014  1:00 PM

Share Permissions – setting deny

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, PowerShell, WMI

The last change to the share permissions functions to modify the Set-SharePermissions functions to enable the application of Deny permissions. The function becomes: #requires -Version 3.0 function Set-SharePermission { [CmdletBinding()] param...


May 18, 2014  12:44 PM

Share Permissions – adding a Deny permission

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, PowerShell, WMI

Modifying the Add-SharePermission function to enable the application of Deny permissions is a simple matter of adding a switch parameter –deny and modifying the way the AcreType is set: #requires -Version 3.0 function Add-SharePermission { [CmdletBinding()] param...


May 18, 2014  8:40 AM

Share Permissions – working with Deny

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, PowerShell, WMI

Permissions can be set to either allow access ot to deny access. The functions I’ve presented so far only work with Allow permissions. Using Deny permissions should be avoided if at all possible but sometimes there’s no alternative. First thing is to modify Get-SharePermission so that it...


May 18, 2014  8:24 AM

Error trapping when getting AD objects

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Active Directory Administration, PowerShell

How many times have you done this: £> Get-ADComputer -Identity "bleh" Get-ADComputer : Cannot find an object with identity: 'bleh' under: 'DC=Manticore,DC=org'. At line:1 char:1 + Get-ADComputer -Identity "bleh" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo :...


May 18, 2014  5:16 AM

Share Permissions – changing

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, PowerShell, PowerShell v3, WMI

So far you’ve seen how to read, remove and add permissions to a share. The final scenario to be covered is modifying a permission. The functions I’ve presented to date only enable you to set Allow permissions on a share. I’ll be covering Deny permissions in later posts. This mimics the way...


May 17, 2014  7:02 AM

Share Permissions – Removing

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, PowerShell, PowerShell v3, WMI

You’ve seen how to read share permissions and how to add share permissions – now its time to remove share permissions. Most of the code we need is in the Add-Sharepermission function – it just needs a bit of a tweak. #requires -Version 3.0 function Remove-SharePermission...


Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: