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

Powershell DSC & Runtime Error Hell

I've been banging my head against the wall with DSC for several months now.  I've made good progress but this mixed mode assembly message is haunting me, it's inconsistent, and really limits my options...

View Article


Sharepoint script

HelloI am trying to get a list of "approved documents" and by whom they been "approved" and whenIs ther a way to do this in powershellregards

View Article


Display shared drive quota in POWERSHELL

I've been googling this for hours and can't find anything that's actually working.I'm trying to use powershell to report the quota limit/size of a shared drive. My query code is:$DiskSize =...

View Article

Script to send email if any service failed

Hi,I want to monitor all services on server. In case of a service failure, it will send an email to a particular email address. In this way administrator will be notified that there is a service...

View Article

convert days to months and days?

Hi,I need to take a a numeric value like 280 (which is really the number of days) and convert it to the number of months and days (eg 9 months and 10 days). Is this possible with PowerShell?Thanks Adam

View Article


old DOS commands that prompt y/n

My organization assigns every employee a personal drive on a network share. For some reason, be it old software installs or bad workstation backups, many users now have a Windows directory on their...

View Article

Start-Process cannot execute psexec.exe

I have working script that use Invoke-Expression to execute psexec in Powershell ISE<# $password is encrypted password, need to unencrypt to pass it to psexec #> $bstr =...

View Article

GetComputerSite()'s server list is empty...

Hey folks -- So I'm working in an Active Directory environment that is healthy.I've run: [System.DirectoryServices.ActiveDirectory.ActiveDirectorySite]::GetComputerSite()And expected the servers...

View Article


List all running scheduled tasks on local/remote machine

Hi All,I'm in need of a PS script, which can list all the active/running scheduled tasks either on local or remote machine.Please share if you have one readily available.Thanks in advance!!!Pavan

View Article


Count Unique EventData elements from Windows Event Log

$global:imagenames = @() $Events = Get-WinEvent -LogName Microsoft-Windows-Sysmon/Operational ForEach($event in $Events){ $eventxmldata = [xml]$event.toxml() $EventData =...

View Article

ActiveDirectory module, how to authenticate to an outside AD environment?

I have an interesting problem and I'm not sure how to work around it.My AD environment is Windows 2008 R2. My workstation in Windows 8.1 NOT joined to active directory.I need to run/develop some PS...

View Article

how to tick a box on AD machine properties?

get-adcomputer mg2014 -Properties *  this of course works and one of the properties it returns is: ProtectedFromAccidentalDeletion    : False    How do you change that to :TRUE ?  We have an OU with...

View Article

How can I use a $variable in a throw?

Re: throw - why can I know get $variable to work in the throw?I want to reference the $strfilename in the throw. Why does this not work?$strfilename = 'c:\temp\bcp\' echo "'$strfilename'" throw "Error:...

View Article


Detect the Primary IP address, mac, ect.

Hi,I need to fill out template with the Machine Name, IP Address, MAC address, Netmask,  IPSubnet,Gateway,DefaultIPGateway,Preferred DNS,DNSHostName,Preferred WINSI think you get the idea. However, I...

View Article

Eventing and Print Jobs

Hey all! I am attempting to write a script that will collect information about print jobs on a print server and write the data to a database. I am trying to get data on print job owner, printer name,...

View Article


Getting All Local Groups, Group Members and Local accounts on all Servers

Hello Everyone,Sorry if this has been covered already, but I didnt see anything that quite answered my question.I've been given the task of generating an Access Control List here at work and I've...

View Article

Image may be NSFW.
Clik here to view.

/Calling function to create Psobject

Hello All,Unable to create the object with function,Please find belowfunction Aka($x,$y){ $hash = @{                    Value1       = $x        Value2       = $y    }...

View Article


CmdLet design advice - Multiple mutually exclusive parameters

Hi everyone, I'm looking for some design advice. I'm building a set of Powershell cmdlets for our product and I want to make sure the fit into the default idioms so that they are easy to use by admins...

View Article

Image may be NSFW.
Clik here to view.

Manage network device port forwarding via PowerShell or Webinterface?

Hello,i would allow a non administrator user to modify the network adapter internet shared ports.I dont know how it is called...With this PowerShell commands i got no information which usefull for...

View Article

Extract username only from MySQL query results to pass into variable

Hi All,I am new Powershell and MySQL and having some trouble with passing a username, returned by a query to a MySQL server, into a variable without the meta data of the field name being copied...

View Article
Browsing all 21975 articles
Browse latest View live


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