Home PowerShell

Windows PowerShell

34 Conversations

Latest Activity

Custom List Message Item

I have a azure web job in C# where i am trying to connect to SPO through connect-sposervice. I have copied the complete Sharepoint online management shell folder from my local into my project and uploaded but still i get the error in web job 

 

D:\home\site
... Read More
64 Views
2 Replies
It can be tricky to use the SPOnline module from a webjob as it has a lot of associated binaries, one option could be to trigger an associated Azure Automation script usi... Read More

I am trying to remove some services from users.  I have the following script:

 

$ApprovedPlans="EXCHANGE_S_ENTERPRISE","SHAREPOINTENTERPRISE","SHAREPOINTWAC","MCOSTANDARD","OFFICESUBSCRIPTION","RMS_S_ENTERPRISE","YAMMER_ENTERPRISE"
$AccountSkuID = (Get-MsolA

... Read More
76 Views
6 Replies

You should be covering two scenarios:

 

1) The user already has the same license applied, so only provide the LicenseOptions

2) The user does not have this license applied,

... Read More

I currently use the below script to connect to the S&C Center. This does not work with MFA.

I was wondering if there is an Updated Module that I could use that supports modern authentication?

 

$Credential = get-credential -Credential username.com

 

$Session =

... Read More
78 Views
2 Replies

Nope, not yet. It's the last of the "modules" I use to get MFA support :(

Best Response

Hi all,

 

I have a quick query, that I'm hoping someone might be able to help me with.

 

I run a number of powershell scripts weekly (Inactive accounts, DA memebers, etc) and the output of each script is emailed to my IT colleagues in either EXCEL or html for

... Read More
71 Views
2 Replies
A quick and easy solution (depending on your security and other requirements) might be to run up an IIS web service and turn on directory browsing, then use convertto-htm... Read More
Best Response

Im using the following code to add properties to an object

 

$ten = Get-MsolCompanyInformation -TenantId $tenantItem
$objTenantData = New-Object -TypeName system.object
$objTenantData | Add-Member -Type NoteProperty -Name AuthorizedServiceInstances -value $
... Read More
56 Views
1 Reply
I am assuming that the Add-member line is just one of many you want to add to the $objTennantData object and that you want the string array added as a single value (let m... Read More
Best Response

Hello everyone,

 

Are you using code review in your team ? (i do but still got a lot of questions)

 

* Do you use a guideline? like this one (by Mike Shepard)?

 

* Do you use PowerShell/PSScriptAnalyzer in your code review?

 

* What's your process if you have one

... Read More
58 Views
1 Reply
Well I'm a Steroids user so I get that taken care of. But I agree with Mike Shepard that scripts that are anything but private should maintain a high level of readability... Read More

Hi All

 

I have long running scripts running against O365 for our tenant. These can take a day or two to complete.  During the run of the script, there can be an interuption where the credentials manager popup requests the credentials again, despite me havi

... Read More
153 Views
4 Replies

Hello,

 

I'm using this one and works great for me : 

 

Set-ExecutionPolicy RemoteSigned
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsof
... Read More

That's just a side effect of broken session to Exchange Online and PowerShell's attempt to recconect to it. The best thing you can do is to optimize your script to run as

... Read More
Best Response

Hi,

 

Disclaimer: I am new to PowerShell, hence why I turn here for your input.

 

Background:

I'm creating a Power BI dashboard based on data exported from the O365 Audit Log. For the moment, I'm not using the recently launched API, but a daily scheduled Power

... Read More
200 Views
8 Replies

Have you checked the parameter "SessionCommand" in the Search-UnifiedAuditLog cmdlet?. By using this you can get all the records. But you need to do the filters in the DB

... Read More

What you are looking for I guess is something like a "NOT" operator, which will allow you to exclude all actions from particular user/account. Unfortunately, I'm not awar

... Read More

Hi,

 

I'd like to be able to manage all of our client Office 365 tenants via PowerShell.

 

However when I try to login to PowerShell using the global admin account credentials, this does not allow me to login to PowerShell.

 

What's the best wasy for me to do w

... Read More
92 Views
2 Replies

Hi,

 

You can try this code, it works for me : 

 

Set-ExecutionPolicy RemoteSigned
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exch
... Read More

Greetings,

 

We need to know a little more details, such as the error you are getting, what command you have tried, etc.  There is a little setup required such as installin

... Read More

Hello, I have set up a virtual machine using the Windows 10 trial VM for Hyper-V (https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/, preview 15.15). I would like to use Powershell Direct to run Powershell scripts on my VM. I believe I've suc

... Read More
55 Views
1 Reply

I managed to resolve the issue. I updated the hyper-v configuration for the vm from 5 to 8. I then used the credential "Host computer name"\IEUser  with password Passw0rd

... Read More

Anyone got a explanation why this is happening? Also tried with " around the text in the input.

Read-host seems to work if i only input one thing like: Sway

Not working when inputting: sway,yammer_enterprise

 

1.PNG2.PNG4.PNG

Read More
89 Views
3 Replies

You're passing a String value, it needs to be list. Try it like this:

 

$newSKU = New-MsolLicenseOptions -AccountSkuId tenant:SKUID -DisabledPlans $SelectedPlans.Split(",")

Read More

Found it out, had to do it like this.

5.PNG

 

Read More
Best Response

I want to use PowerShell to export the most recent week's worth of Admin Message Center Messages to a spreadsheet because I want to annotate each item with what I am planning to do about each announcement. #Governance

 

I have an account for this purpose th

... Read More
188 Views
7 Replies

Hi Michael,

The v2 API (preview) requires that you register the script/app.  One immediate term option is to use the non-preview v1 API.  Sample code may be found here (

... Read More

Hello Everyone,

 

If you could share few videos which will easily make understand of the windows powershell better for server admin 

77 Views
1 Reply

Just before the "Windows PowerShell" section became available I posted some information that me be on interest under "Windows Server PowerShell" section. Go ahead and check it out at:

 

https://techcommunity.microsoft.com/t5/Windows-Server-PowerShell/PowerShell-Open-Source-and-Editor-of-Choice/m-p/15287#M13

... Read More
154 Views
4 Replies
I agree Sublime is very nice. But also very pricey. I've been testing Atom (atom.io) which is an open source editor w/ a similar package system that Sublime uses. So far ... Read More

I tried that as my editor when I was stuck with a Mac (IBM saving money deploying Macbook Pros) and have to say, Sublime was a much better editor on that platform for me.

Read More