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

Best way to read the Certificate in powershell?

Hi team,I have a module, which needs a certificate to encrypt:Till date I am using it as part of the script as $var(the data type is string) . When I pass this to the below logic it's working. $Cert =...

View Article


Script to delete files older than N days but not delete files from X list days

I am looking the way to delete all files older than 45 days in PS but want save files from dates 30 and 31 or the last file of each month.

View Article


Scheduled reboot with a message

Hi together,I'd like to realize following:1) Restart all member computers in a domain group in a scheduled day / time.2) Scheduled day / time is on Wednesday each 2 weeks.3) 15 minutes before the...

View Article

Unable to import ActiveDirectory module on Windows 2012 R2 using Powershell...

We have a Windows 2012 R2 OS with the default Powershell version 4.0 installed.PS C:\Users\Administrator> $PSVersionTable Name                           Value ----                           -----...

View Article

Remove ActiveSync Devices in EXO using ForEach statements

I looking to remove <g class="gr_ gr_5 gr-alert gr_spell gr_run_anim gr_inline_cards ContextualSpelling ins-del multiReplace" data-gr-id="5" id="5">activesync</g> devices associated with a...

View Article


Uninstalling Software using PowerShell

Right, this is what I have.. I understand why its not working but cant think of way round it or easier way to get to the point I want to be at..I have script where I can check disk space and install on...

View Article

How can I rename files and append datetime?

Hi,  I need rename many files append _datetime (20170124_145010) before their extension and move them to another directory. How can I do it? I would like to run it within a stored procedure. Ex:...

View Article

Help adding details of power shell output in email

Hi All,I've stolen some and written some of the script below that should show the before status of the MMA service and restarting the service then showing the status of the service after it was...

View Article


Help with a script to keep files....

Hey guys - new to PS and need some help.  I have a script to clean up log files in a directory, but I need to refine it slightly. Currently, it deletes files older than 3 days, which is what I want,...

View Article


Image may be NSFW.
Clik here to view.

File in Use open Read only

$AllMyDocs=Get-ChildItem -Path $oneFolder -Filter * -Recurse | Select Name, FullName | where {($_.Name -like "*.docx") -or ($_.Name -like "*.doc")} ForEach ($myDoc in $AllMyDocs) { $Name=($myDoc.Name)...

View Article

syntax of repeated conditionals?

Hi Experts, I'm new to powershell and wondering why this throws an error :$all =[long] [Microsoft.SqlServer.Management.Smo.DatabaseObjectTypes]::Table ` -bor...

View Article

Windows Update is being shutdown for new portal

There are a number of clear impacts.Read this article for impacts and the new method (RESTfull API) of accessing...

View Article

Adding printer under System account fails

Added a printer by IP to computer-1.Than shared it as printer-1, password protected sharing is turned off.Than from another computer, trying to add it using Add-Printer cmdlet.Add-Printer...

View Article


How to change home drive server from list

HiI have a list of user which I need to change the home drive path - I am starting from this script and I would like to use a foreach command but I can't my head around:Get-ADUser -filter...

View Article

Format PowerShell Code

Hi All,I am currently using the PowerShell ISE to write PowerShell scripts at work.Is there anyway I can format the code to make it more easier to read? In Visual Studio it is easy to format any C#...

View Article


AppLocker rules (White List) do not work in W7 for PowerShell 5 scrips

In version 5, PowerShell now reduces its functionality to “Constrained Mode” for both interactive input and user-authored scripts when it detects that PowerShell scripts have an ‘Allow Mode’ policy...

View Article

generate normal password for ad users from csv

hey guys , im trying to reset ad users from a csv file and i found numerous powershell scripts about it and it works greatbut the problem is the generated password are too heave for example "6{_@?79v"...

View Article


Newbie looking at creating a script to add users groups based on mailbox DB.

Hi,I've only ever used basic PS admin commands for exporting or importing basic info on AD/Exchange.I'm looking to create a script which does the following:Gets users from a particular AD group (I can...

View Article

Search_AD_Local_Admin_Email.ps1 is not working

Hi everyone,The following script is not working with PowerShell 2.0 or 4.0 (Win2008R2 or Win2012R2), can someone help me out?...

View Article

How to add my script to one variable

Hello,I have a script that I need to be put in to a variable so I can have the script output emailed. Is there a way to do that wit this script? $srvName = "Adobe Acrobat Update Service" $servicePrior...

View Article
Browsing all 21975 articles
Browse latest View live


Latest Images

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