Quantcast
Channel: /r/powershell – How to Code .NET
Browsing all 8793 articles
Browse latest View live

[Question]HELP: Write 7 PS variables to CSV file with export-csv cmdlet

Hi all, I’m new to PowerShell and have been working on a PowerShell script that should Collect Certain attributes of the machine its running on Write those values to a CSV file Kick off a Win10 Ent...

View Article


Help skipping empty fields in csv file for AD automation

Hi guys, I’m very new powershell scripting. I know bash very well and I’m okay at batch and vbscript. Here is my script: [code]ForEach ($SecurityGroup in ($User.SecurityGroups)) $Userlist = Import-Csv...

View Article


Tracking the State of PowerShell Runspaces in a Runspacepool

submitted by /u/boeprox [link] [comments] The post Tracking the State of PowerShell Runspaces in a Runspacepool appeared first on How to Code .NET.

View Article

Scheduled Task: New-PSDrive Within a Job – Why is the Authentication Preserved?

Scheduled Task: New-PSDrive Within a Job – Why is the Authentication Preserved? I have a scheduled task on a Windows 7 Pro workstation (with PowerShell 5.0). The workstation is a domain member and the...

View Article

Powershell variable question

I am working on my first real major powershell project and ran into a deadend. So write now I have a daily CSV that I need to check for values that change so for example: I am looking for 4 in...

View Article


[Script Sharing]Printer Dashboard using PowerShell, AngularJS, and Firebase.

tldr: Printer Dashboard using Powershell, AngularJS, and Firebase So I script a lot at work. It keeps me sane. One thing that doesn’t, are printers. One thing I REALLY didn’t want to do was drive from...

View Article

ConvertFrom-JSON not working without explicit pipe through out-string??

Hi I have just had an odd problem this morning and I don’t know why my fix works. $npmPackageDetails = & npm show $npmPackageName # Get the versions from the json response and select the latest...

View Article

Powershell with winform GUI – how to use job to update a textbox without...

I’m working on a simple powershell script with a winform and I am wondering how to use jobs for updating the GUI without the form freezing up? For example if I have a richtextbox on the form and I...

View Article


Setting special permission on a folder?

I want to set some very specific permissions on a folder, so they only can write data into the folder. i have already tried the “Read, Write” but that gives permissions to change the proberties too...

View Article


ok Need help with this script

I am trying to make a script that will allow staff to reset passwords for users and I am pretty far along. however I am having trouble getting the script to output to a form for the user. when I run...

View Article

[Question] – Issues trying to set-aduser -identity $variable -replace...

I’m trying to automate the task of mirroring users so our helpdesk doesn’t have to do it by hand, since its a pain in the ass. I prompt for two variables using read-host to define the user and the...

View Article

[Question] Variable used between separate scripts

How would I go about making a variable stay in memory after the script has execute and moved on to a different script? Example: User executes a.ps1. When that script launches, the user enters 1234 and...

View Article

SSH Script Help….

Hello /r/powershell, I need to write a PowerShell script that will SSH into all of my switches and get the configuration. Now, I made a script that works to SSH into my ESXi server and run a command....

View Article


combing data [multiple objects]

I’ve got a custom object which is sql query combining 2 asset info sources (info from 2 sql servers from a sql view) $info = $ds.Tables | sort assnbri | ForEach-Object {Add-Member -InputObject $_...

View Article

Using an array for the Body in Send-MailMessage?

So the goal is for me to send myself a report of inactive computers every week through a scheduled task. That scheduled task will run a Powershell script to query get all inactive computers and put...

View Article


[question]What am I missing?

I’m trying to write a script that will add multiple users to the Virtual Machine I have created (MS Server 2008 r2). Googling and researching has gotten me this far, but it’s still only doing bits and...

View Article

Question: How do I run a script up until a Restart and then continue to run...

I am writing a script to automate server configuration in Hyper-V. At the moment I can assign IP info, time zone, rename host. It then moves on to install ADDS and DHCP. Afterwards it will attempt to...

View Article


Finding Everyone user from all folders on a file server

Hi Guys, I want to find all the directories and files a particular user has access to such as Everyone account. Normally I have been using a script like below to recursively search an NTFS directory...

View Article

Error downloading from FTP script

Script If I take away the file of $LocalFile it gives me the ERROR “Can’t find bla bla…”. If I ONLY take away “$Run.Write($FileContent, 0, $FileContent.Length)” it gives me NO ERROR but doesn’t...

View Article

HPE has updated their Powershell Toolkits for BIOS, iLO, REST, Redfish, and OA

I’d include links, but you know how the HPE site is. OA is currently 404’d for me, but there’s some handy new functionality, including a new feature I suddenly needed for an unexpected compliance...

View Article
Browsing all 8793 articles
Browse latest View live