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

Image may be NSFW.
Clik here to view.

not finding RDSConfiguration in Remote desktop services

when i go to cd RDS: and do DIR i see only LicenseServer not RDSConfiguration because of which i am not able to go to RDSConfiguration and change the session limits. Please refer the image for more...

View Article


Simple Progress Bar

HiI am trying to get a progress bar working in my form, not having much luck. I have started a small basic script to help me better understand the functions of progress bars in forms, but even this is...

View Article


Some simple tasks in excel with powershell

Hi,need advice on some basic tasks and actions in Microsoft Excel using powershellsearched about these but did not find many useful pages1- How can i copy a whole sheet to another !? I need sheet 1 to...

View Article

Running Powershell code on remote machine using C# - EXPERT HELP NEEDED

Hi guyz,i facing this issue from a long time.Im Uisng Powershell for remote operations , and sometimes for installations and uninstallations also.The problem , is for example, im remotely installing...

View Article

script to search for the string within files vs. within filenames.

Hi Experts,I am looking for a power shell cmdlet or script to perform a search against a network drive for the term "xxxxx". XXX could be any string or sentence defined as criteria of the search. I...

View Article


Find and Replace using RegEx

Can anyone help?I have a script to find a regex of information, my question is :- can I replace the items matched with with another regex?such as ... $item -replace $regex , $regex2or with an array, so...

View Article

How to sort the send-mailmessage body?

My code like this.# Import Module of Active Directory Import-Module -Name ActiveDirectory# Email Variables $smtp = "10.10.10.10" $to = alan@company.com $from = "alan@company.com" $subject = "Enable OCS...

View Article

How do I place a variable in a string? with get-ADComputer -filter ... Check...

I'm searching AD with a list of partial computernames. The following works like a charm: Get-ADComputer -Filter 'Name -like "*comp1*"' | Format-Table Name,DistinguishedNameOutput looks like: Name...

View Article


Image may be NSFW.
Clik here to view.

Permission issue when running Invoke-SqlCmd

Hey Guys,I've written a script to drop all the SQL security logins from all databases in a instance in my lab.I'm using the cmdlet Invoke-SqlCmd to run TSQL DROP SCHEMA and DROP USER commands.When I...

View Article


In Powershell - I want to populate empty emailaddress in activedirectory...

In Powershell - I want to populate empty emailaddress in activedirectory which is currently empty. I want to populate the field withfirstname.lastname@company.caI have about 100 users i want this...

View Article

Optional Credentials - is there an easier way?

so, this sample works . .. function credexample { Param($ComputerName=".", $Credential=$null) if ($Credential -ne $null) { gwmi win32_process -ComputerName $Computername -Credential $Credential } else...

View Article

Image may be NSFW.
Clik here to view.

[reflection.assembly]::LoadWithPartialName() problems

I have some nutty behavior loading classes from a GAC'ed assembly. Specifically I'm working with SharePoint's Search Administration object model, which requires the "Microsoft.Office.Server.Search"...

View Article

get-adgroupmember and foreign security principal

I have put a few powershell commands together to list users in our domain bulitin\Administrators group and our Domain Admins group. This is really nice if you want to audit who has god-like permissions...

View Article


Active Directory export array missing certain users -DirectorySearcher, CSVDE...

Wondering if anyone could assist me with a script I'm working on. I've decided to be a big boy and stop using Command Prompt so instead of using the csvde utility I wrote a ps1 script seen below... #...

View Article

How could I verify a password is correct before continuing the script?

I have a PS script which takes user input to build a command list, and then SSH'es into a network device to excute the command list.  The network device is not AD integrated.  The user inputs the...

View Article


PS3 Export-CSV -Append from multiple instances to the same csv file.

Just wondering whether there are any examples of the following out there:Using multithreading I shall want to update a central csv file which will mean I will need to include some logic on the...

View Article

Issue running a PowerShell command from a batch file

Hey everybody. I have what seems to be a simple issue but I can't quite figure it out.I'm trying to run these commands to delete a profile using a batch file:$UserProfile = Get-WmiObject -Class -Filter...

View Article


Moving certs between stores using powershell v3

Hello,I'm trying to write a script that will test to see if a particular certificate is there and if so move it to the disallowed store.  I've written this script but I can't figure out why it's not...

View Article

Connecting to the AD Configuration Partition using Powershell

I am trying to make a connection using powershell to the Configuration Partition in Active Directoy using PowerShell. I have seen may examples on the internet on how to connect to the RootDSE to look...

View Article

Computer Name in output from Invoke-Command

Is there a way to know to which computer an output text belongs when executing an Invoke-Command on a list of computers?If I run something like this:Invoke-Command -ComputerName Computer1,Computer2...

View Article
Browsing all 21975 articles
Browse latest View live


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