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

Pipeline variable - scope number exceeded

Hello,I have a script to select the oldest file form $srcdatapath folder:$oldFile = Get-ChildItem -Path $srcDataPath | Sort-Object -Property LastWriteTime | Select-Object -First 1Then I need to select...

View Article


need help to text a script for Remove-ADGroupMember

hi all,i need to write a script that when executed remove the user that execute it from all the ad group it is member, or from a specified groupplease can u help me text itthankscheers

View Article


Suggest adding Powershell equivalent cmdlet link in Windows commands doc

I was looking for mountvol Powershell equivalent and did not find it in Windows command doc and that apply to other commands too. I think it is good to have a well known location to start looking for...

View Article

Suggest script to restart SNMP service forcefully

Hi ALl,I am new to power shell, I have cmdlet to restart the SNMP service forcefully "restart-service snmp -force", could you please suggest script to be saved and executed from power shell to restart...

View Article

Server 2016 update issue ("Microsoft.Update.Session")

Hello,I am trying to apply all available Windows Updates to fresh installation of Windows Server 2016 with PowerShell.It's a fresh installation from...

View Article


Null Identity error when trying to get SAM accountname

Hi, I am trying to run real simple script to get the SAMaccountname from a text file. I am a supernoober with PowerShell. Every time I run this command I receive the following error.Get-ADUser : Cannot...

View Article

Issue setting mailboxpermission based on user input

I'm trying to create a powershell script for our first line support to help them with the account creation process in Office 365. One step of the script is to get a list of shared mailboxes and ask the...

View Article

Push json string into arraylist convert json element into string instead of...

$t=@() $r= new-object -type PSObject class { [string]$a [string[]]$b } $c =get-adgroupmember -recrisive $team| select SamAccountName $c.b = $c.SamAccountName $c.a="dummy" $t += $c $r | add-member -name...

View Article


Msft_Volume results: multiple records for 'D:'

Hello, Im getting some strange results for Msft_Volume queryGet-WmiObject -Query "SELECT * FROM Msft_Volume" -Namespace Root/Microsoft/Windows/StorageI see 'D' drive six times! I there any explanation...

View Article


Set ACL

HelloI have a folder on the server for end-users' archived emails.  Of course each user will only be able to access their own folder.The foldernames are the same as the SamUserAccount name (first...

View Article

Copy Certificate from Contact to User

Hey Guys, i've been struggeling to find a solution for a few days but nothing yet! maybe someone can help me figure this one out :)i have a user and a contact in an AD, both are the same person.the...

View Article

AUTOMATE SERVER UPTIME PERCENTAGE AND SEND TO E_MAIL

Good afternoon, I am trying to create a power shell script to give me a % of up time on production serversI was able to run the script and it shows good output on the screen but sends nothing to...

View Article

Azure Az Powershell Module Crashes Powershell/Unresponsive

Apologies if this is not the correct forum, but was only one I could find related as it's powershellCurrently the new Azure Az Module here...

View Article


PowerShell: Exporting Active Directory Users and their Managers

I need a query to export Active Directory Users and their managers using PowerShell.

View Article

Problems using Get-TroubleshootingPack

I am trying to use Get-Troubleshooting pack in Windows 2016 to create an answer file to allow me to automate one particular fix.If I do this:$TSPackfolders = Get-ChildItem -Path...

View Article


Unable to process password variable in powershell because of special characters

Hi Team, I am working on a PS script to install VSTS agents on my Azure VMs through an Azure DevOps Release Pipeline.Here in the below script, I am passing a Service Account Password, which is set by...

View Article

Get-WinEvent remote successfully retrieves large number of events, then...

Trying to read Windows Event logs via Powershell 5.1 on Windows 10 (7GB memory) to Windows 2016 Server (4GB memory).This pulls a couple of hundred event messages, then fails. When running locally, runs...

View Article


Run Powershell script as Scheduled task, that uses Excel COM object

What am I missing here.. I have  Powershell script that uses the Quest AD cmdlets to get computer information from AD and populate an Excel spreadsheet with the data.The script works fine, so I created...

View Article

Powershell to search excel returning different row values

Hello,I am having some problems to try to implement this script. I have one big excel with several columns and I would like to search different values returning not only the row and column of that...

View Article

SQLPS used to work before sql update

I have a few .ps1 files being called from sql jobs that used to work and now i'm getting an error when the SQLPS module tries to load. The error specifically says: "...job step recieved an error at...

View Article
Browsing all 21975 articles
Browse latest View live


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