Quantcast
Channel: PowerShell
Browsing all 15370 articles
Browse latest View live

Do Powershell runspaces open using the current PSSession?

I was under the assumption that PSRunspaces opened using the current PSSession that was active but when I run the script below I get the error message that New/Set-Mailcontact are not recognised...

View Article


PowerShell Scripting to Replicate Cloud & SaaS Data to SQL Server

I received this little gem in my SQL Server Central newsletter and thought others might find it useful. Querying Google Sheets and bringing that data into a local SQL database. There are also Cmdlets...

View Article


PS Script to automate Windows and MS Updates

Using the following module...https://gallery.technet.microsoft.com/scriptcenter/2d191bcd-3308-4edd-9de2-88dff796b0bcI’ve written a script which (nearly) enables proxy server, downloads Windows and MS...

View Article

Is there a better way to get a consistent result?

Good morning,I have been pounding away at Frankensteining a daily status report to run as a scheduled task on our DC. The data aggregation is working flawlessly, but for some reason I get completely...

View Article

powershell web access

just going through microsoft virtual academy course on powershell they were showing how to set up the web interface and then access it through an iPhone to run commands etc.obviously they were falling...

View Article


Powershell script to upload file to Onedrive business

i got one script to upload to onedrive business and its...

View Article

Retrive LastWriteTime property of files

I am trying to write a PowerShell script that:Reads contents, gets LastWriteTime of each file, If the LastWriteTime of a file is older than a certain date, moves the file to dir.

View Article

Create Scheduled task with Run as highest level, Whether user is logged or not

For some reason this task wont run I want to set a credential by choice Text$STPrincipal = New-ScheduledTaskPrincipal -UserID "NT AUTHORITY\SYSTEM" -LogonType ServiceAccount -RunLevel Highest...

View Article


Some basic PS questions:

Sorry for these newbie questions but I am new to Powershell.1.) How do I find out my current Powershell version (under 64bit Win 7)?2.) What is the newest PowerShell version and how do I download it...

View Article


Delete Active Directory Users and Data

HiI'm creating a script that will look in a specifik OU and delete all the disabled user accounts, the attached home folder and the also look if there is a folder starting with the "samaccountname" on...

View Article

MDT OEM License Automation

Hey guys,I would like to automate the process of my MDT deployment to pull the OEM license key from device and then apply it to windows, If OEM can not be applied, apply VLK. Here is what I have so...

View Article

Edit powershell scripts to search entire volume

Hi guys,I found the following script that works well, but it will only search the first level of folders. Any way t o edit this guy to search the entire C: drive? thanks!!function delete-remotefile {...

View Article

Powershell GURU's can you explain what [void] [Sys...Part...Name...do

Can someone quickly explain to me what this is doing? I some what understand, but hate not knowing for certain....Powershell[void]...

View Article


Converting makecert script to one using New-SelfSignedCertificate

My certificate foo is clearly weak! I have an old script that uses makecert.exe (the old SDK app) to create a root cert, then creates a signe client cert - these certs being for Azure.Here's the...

View Article

get description of specific computer in AD

I am messing around with some batch scripts and one of the things i am doing is trying to get the description of a computer i look for in ADset /p var1= Powershell -Command "& {Get-ADComputer...

View Article


Powershell Script for Enabled Users, LastLogonDate > 30 Days

I'm trying to come up with a script that will do the following:Search an OU and belowFind Enabled users whoseLastLogonDate 30 days Filter out if LastLogonDate is empty (or null) as in they have never...

View Article

What package providers do you use for PowerShell Package Manager?

Looking at Find-PackageProvider and there are a TON. Which one do you guys mainly use? Or top 5? I've used chocolately, but I've noticed that sometimes it doesn't install apps properly

View Article


How can I install msu file?

I am having trouble creating a script for powershell update. My main script is below.Text$path = (New-Item "C:\Win8.1AndW2K12R2x64" -type directory) $url =...

View Article

Compare string values with a similar function "startsWith()"

Assume I have defined a variable with a value like$mypath = "D:\logfile"Now I want to find out if the value of a another variable starts with the values from the variable mentioned above. I am thinking...

View Article

Always automatically execute PowerShell script *.ps1 by double click?

I am new to PowerShell scripting. One of the first things I learned is that I (normally !) cannot execute a Powershell script by double clicking on it (similar to *.bat Batch Scripts). Instead I always...

View Article
Browsing all 15370 articles
Browse latest View live


Latest Images