Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Browsing all 6937 articles
Browse latest View live

MySQL ODBC Connection Failure

$connection = New-Object System.Data.Odbc.OdbcConnection$connectionString = "Driver={MySQL ODBC 5.2 ANSI Driver};Server=$server;Uid=$uid;Pwd=$pwd;Database=$db;"$connection.ConnectionString =...

View Article


Other than a return code, is there a way to return an object (e.g. hash...

This is a general question:I have a 2 powershell scripts (PS1 and PS2) in which one calls the other.On execution from the command-line, at some point in PS1, PS2 is executed (at the moment this is done...

View Article


View DSC Configuration Drift

Q. How can I detect drift between an applied PowerShell DSC and the current state of a machine?A. The simplest way to check for drift of configuration between the applied configuration and the current...

View Article

Getting all Licensed Office 365 users with PowerShell

Quite often, it is required to have an overview of all the licensed users within an Office 365 tenant. Using PowerShell and the Office 365 cmdlets, it is possible to get a list of users (licensed...

View Article

PowerShell – Cloning ConfigMgr 2012 Security Roles

The permissions associated with built-in ConfigMgr 2012 security roles cannot be modified; therefore to meet operational requirements I always clone several of the built-in security roles. Repeating...

View Article


PowerShell Command to List Users and Password Expiration Dates

Here from TechNet is a quick PowerShell script to list enabled Active Directory Accounts and their password expiration dates:Read More

View Article

PowerShell script to extract all solutions from SharePoint Farm to local file...

This code describes about PowerShell script to extract all solutions from SharePoint Farm to local file system.Read More

View Article

Rapid PowerShell Development with ISESteroids

Should you frequently experience de-ja-vus while writing PowerShell code – “didn’t I type in this [function|loop|statement|you name it] before?”, “how did this darn syntax for [you name it] work...

View Article


Comment Based Help inside function messes up SYNTAX section of Get-Help

Hello,I'm learning PowerShell and I'm writing a function with parameter validation and parameter sets. When testing, I used Get-Help <myFunction> a lot to see how PowerShell interpreted my...

View Article


Transportrule exporting as readable format

Hi,Anyone tried exporting transportrules in readable format? I am looking to export (Export-TransportRuleCollection) to csv or HTML format so that I can use that for meeting discussion doc.. I tried...

View Article

New-Mailbox / Set-CalendarProcessing / Set-Mailbox /Add-MailboxPermission -->...

Hey Guys,time to admit defeat and post on the forum..($RoomsAndMember.Users).Split(";") seemed to work for all but the last command:Add-MailboxPermission -Identity $RoomsAndMember.Alias -User...

View Article

Powershell script to retrieve members from several groups

Hello. Please bare with me as I am new to Powershell. After getting into it I can't believe that I haven't been using this longer! My problem is that I'm so far unsuccessful in writing a script that...

View Article

remoting outside domain

Please forgive me if I ask anything too obvious as I am brand new to Powershell.  I'm trying to establish a remote connection to machines in two separate domains (both outside my current domain)....

View Article


LDAP Query using ADSI

All the new user accounts created in Active Directory are kept as disabled and the option "user must change password on next login" is ticked. This accounts will remain as disabled for 7 days and in...

View Article

Migrate large folder structure/files

I need to migrate large folder structures.The target folder structure is not equal to the source structure.For one single folder (and sub-folders) I have created a csv file which I use as input file...

View Article


PowerShell to edit AD users

So I'm not very knowledgeable with PowerShell, and am hoping to get a little help with writing a script.  Any help is greatly appreciated.The logic of the script is as follows:Loop through all the...

View Article

enter-pssession

i want to install some msi/exe's remotely but how can i do this?i was trying out:Enter-PSSession -ComputerName Tes1 -Credential $cred -EnableNetworkAccessmsiexec .\install_flash_player_17_active_x.msi...

View Article


Validation of missing permission when using Get-WmiObject before execution

Hi,How can i validate permissions befor running Get-WmiObject execution and get a true or false value that everything is okay?$x = "Something"if($x -eq "true"){$LocalUsers = Get-WmiObject -Class...

View Article

Trouble parsing WMI output

Hi, I would really appreciate some help on this as well as a resource recommendation where i can learn this stuff... $OS=Get-WmiObject -ComputerName ROS420DVAPP01V -Class Win32_OperatingSystem | Select...

View Article

Help with Invoke-RestMethod request

Sorry if this is a silly question, i am pretty new to APIs and the way invoke-restmethod takes the request. I am trying to submit the below request but powershell is failing at "windows_data_drives"...

View Article
Browsing all 6937 articles
Browse latest View live