Quantcast
Channel: Windows PowerShell forum
Browsing all 21975 articles
Browse latest View live

Enable Remote Desktop Connections with PowerShell

What is the easiest way to enable remote desktop connections on Windows 7, with powershell?

View Article


Enter-PSSession does not work when a IPV6 address is entered as the -Computer...

I cannot get Enter-PSSession to work with a specific IPV6 address and when TrustedHosts is also set to this address.NOTE:  If TrustedHosts is set to "*", then the command succeeds, so I'm pretty sure...

View Article


Move folder

Hello,need help with little script, now i work with this (manualy)$text = Get-Content D:\move.txt$dir = Get-ChildItem D:\Oldforeach ($item in $text) {  foreach ($folder in $dir) {    if ($folder.name...

View Article

Server 2008 R2 Powershell version 4 cannot use Get-Net* (anything) commands

Brand new to PS here.I have a new install of 2008R2 and have updated to Powershell 4 by installing Windows Management Framework 4.0. The system has DotNET 4.5.1 on it as well.I am trying to run a...

View Article

Outlook Account Settings

HiI need to add a second account to all users outlook profile.Is this possible via a powershell script?Thanks

View Article


Image may be NSFW.
Clik here to view.

Using powershell to write to an access database from a .csv file

Writing to an access database seems similar in powershell to how I've always did it in vbscript but there are a few minor differences I don't fully understand. The script below is how I have been...

View Article

Generate Excel which Shows ADUsers and his Groups in a Matrix with AllGroups

Hi There.I Need an Excel table for managemet, which Shows the following:The Colums should be named as Username ActiveDirectory and some Properties and ALL Groups which are availible in Active...

View Article

Change NIC Adapter binding order

Hi All,I've looked through many articles and built a script that changes the registry keys for:"HKLM:\SYSTEM\CurrentControlSet\services\Tcpip\Linkage\"...

View Article


Can I determine if my Lenovo Thinkpad is docked?

I want to be able to determine if my Lenovo Thinkpad is in it's docking station or not. I found that this may be available info on some PCs via the ChassisTypes setting in WMI (e.g. (gwmi...

View Article


MAC address range

Hi,I am looking for a way to write out all MAC addresses between a start and end MAC address. Is there any method in doing this easily in Powershell? Is yes, how?Thank you

View Article

Add variables together (Beginner)

Hi - I'm trying to write a script that will back up a folder from my DropBox, but adding a date element so that when the script is run again (say the next day....) the file name isn't a duplicate. I'm...

View Article

Can't get ValueFromPipelineByPropertyName to work with Get-ADComputer

Hi!I am trying to create a CMDlet that will get input from Get-ADuser or Get-ADComputer but i can't get it to work with the ValueFromPipelineByPropertyName property.The script below only outputs the...

View Article

Image may be NSFW.
Clik here to view.

Incorrect colours displayed by Write-Host

Much of my PowerShell is reporting and I like to use coloured output to make the results easier to interpret.  I have on numerous occasions run into a problem with the wrong colours being displayed by...

View Article


GetHashCode to find Doubles; Can you do it better?

Hi guys!Last month i post a code of mine(The Full Code is here:...

View Article

checking user privilages of account running script

   I have a powershell script that occasionally fails on systems that aren't running it with the correct account.What I want to do is put a check at the beginning of the script to check that the user...

View Article


PowerShell Script to list a server's users, groups, permissions, etc.

I'm looking for a PowerShell script that will query and output all the local and AD users, service accounts, and groups on a given Windows servers. I need the script to recursively list the members of...

View Article

Defining a object array in a C# custom type

I'm pulling information from a web service using New-WebServiceProxy with GetRecords, and manipulating how it displays in PS using a custom type.  For the sake of the question, the PS code looks...

View Article


Detect if key is held

I am at a loss on how to handle this. I want a little snippet of code that  could detect if a key is held down during the code execution.So for example if you are holding shift while the code runs it...

View Article

Defining a object array in a C# custom type

I'm pulling information from a web service using PowerShell's New-WebServiceProxy with GetRecords, and manipulating how it displays in PS using a custom type.  For the sake of the question, the PS code...

View Article

How to export all AD objects into .xlsx file?

Hi Folks,I am novice to PowerShell Scripting and managed to build a query which can fetch user object in .csv file.Here is Query I used for fetching the AD dataImport-Module Activedirectory Get-ADuser...

View Article
Browsing all 21975 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>