Home

Windows PowerShell

56 Conversations

Latest Activity

Custom List Message Item

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
722 Views
14 Replies

Hi,

 

You can download the latest MFA enabled Powershell from EAC. It contains the cmdlet name connect-IPPSsession which will connect to S&C.

 

2017-08-30_17-48-21.png

Read More

I contacted Microsoft Support today.  This the response

 

"I am aware of this limitation however when I checked in our RoadMap site I don’t see any mentioning of this as a

... Read More

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

Best Response

Team ,

 

I need a solution here , I am trying to connect my VM which is running in Hyper-V and I would like to deploy some of the scripts which will run automatically inside the VM and then it will create a text file which I would like to export it to the b

... Read More
50 Views
1 Reply

https://www.howtogeek.com/117192/how-to-run-powershell-commands-on-remote-computers/

 

Make shure the VM and abse machine are on the same network, that the VM is not set to

... Read More

We have the NAS storage and we are all accessing our users profiles and share profiles from the NAS storage.
We need to restrict the users profiles size below 500 MB thershold, So is it possible to generate the users profile size automated report to each u

... Read More
136 Views
5 Replies
error

Hi,

You can try this script .

$RootFolder = "E:\Profiles"
$paths = Get-ChildItem $RootFolder   
$FolderList =@()
Foreach ( $path in $paths)
{


$colItems = (Get-ChildItem $
... Read More
Best Response

Has anyone had a problem logging into skype for business for Powershell using a domain other than the @domain.onmicrosoft.com?  Every single time I attempt to login it will give an error.  I have had success when it was a client that still had the generic

... Read More
64 Views
2 Replies

Late to the party, but have you tried adding OverrideAdminDomain with your preferred credentials?  You should be able to use your user@domain.com account, but tell it to

... Read More

Works just fine here, and has been working fine for years with custom domain. Any particular error you are getting? Perhaps you have MFA enabled and using older/non-ADAL

... Read More

Here's a fun one...I have about 3500 users licensed with E1.   I have about 700+ of those users who do NOT have Exchange Online Plan 1 activated.   Once those are activated, I will then need to apply an Exchange Online Archive license, and THEN add to my

... Read More
46 Views
2 Replies

To filter out users with some specific service disabled, you can use something like:

 

Get-MsolUser  | ? {$_.Licenses.ServiceStatus | ? {$_.ServicePlan.ServiceName -eq "EXC

... Read More
Best Response

Hi

 

i need to check when cloud users last logged on so i can do some housekeeping. These are cloud account so can not user exchange reports i have seen only for this

 

I have created this script but just need to get the out also of last logon time or date

 

ge

... Read More
38 Views
1 Reply

Look at the Activity report under O365 Admin center -> Reports -> Usage (or here https://portal.office.com/adminportal/home#/reportsUsage/LicenseActivity). It will give y

... Read More
Best Response

Will this say that Array is not supported by set-CsRGSHolidayset?

DGD_M-QXcAAbMoM.jpg

Read More
123 Views
7 Replies

The error message says that it can't convert your untyped (object[]) array to the required type.

Try to specify the type for array elements:

[Microsoft.Rtc.Rgs.Management.W

... Read More

The right way to add is descibred here: https://technet.microsoft.com/en-us/library/gg398736.aspx

 

The following example is what you are looking for:

$x = New-CsRgsHoliday 
... Read More

I have a mandate from my Director to turn off all new O365 services that are released (if possible) at the user level so they can be turned on at pilot levels for testing before we make available to everyone. This is easily enough done by running a set-ms

... Read More
241 Views
4 Replies

Have you looked into group-based licensing? Almost everyone I show this to abandons their scripted approach, it's pretty good.

 

https://practical365.com/blog/simplifying-office-365-license-control-azure-ad-group-based-license-management/

Read More

Hi All ,

 

I am unable to remove Hyper V from my client machine using below script . 

For your information , I am running the below script using elevated priviledge..

 

Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All

 

Getting the error

... Read More
80 Views
3 Replies

Have you tried doing it using GUI?

From  the control panel.

I am surprise to see where there is no response from anybody for my query !! 

Hello, 

I wanted to know if there is a script that can send an email when an event is log

137 Views
4 Replies
Here’s how it works:

1) In Event viewer, find the event log you want to watch. Find the event you are looking for and right click it and choose “Attach a Task To this Even... Read More
There plenty of these, just choose :) one of the examples https://gallery.technet.microsoft.com/PowerShell-Script-to-Send-873dc0b6 Read More
https://github.com/AlexanderHolmeset/Skype-for-Business-Automatic-RGS-Holidayset/blob/master/SkypeForBusines_Automatic_RGS_Holiday.ps1
Any idea why i get the output that is on the black shell window? It only stores one day correctly.

Should output like the ... Read More
87 Views
2 Replies

Looks like what my script does is that it creates a bunch of holidaylist.

Need to be like this instead: -Holidaylist($a,$b,$c)

Any idea how i can do that?

 

Read More

I wrote functions to encrypt and decrypt shared passwords. They work great on windows but we need to be able to run them on the Macs too. Part of the voodoo is an RSA cert loaded on each machine that exposes its private key to do the encryption/decryption

... Read More
41 Views
0 Reply

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
916 Views
16 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 guys,

 

Can someone tell me what is wrong with attached script. When I change my own tenant settings and run this, I got below error. I have gone it trought a dosens of times and I just can't see what I'm missing.

 

I am running this script on SPO shell an

... Read More
100 Views
4 Replies

Hi Anna-Maria,

 

You have a problem with encoding where a few dashes (-) are replaced with the text –. This usually happens when copying and pasting text between differen

... Read More

Hi,

Here i attached modified script,  it will solve your issue.

i need to export users in powershell with centricaplc.onmicrosoft.com domain and are licenced

 

i tried this command doesnt work

 

Get-MsolUser -All | Where-Object {$_.Domain -eq "centricaplc.onmicrosoft.com"} | Export-CSV c:\support\cloud.csv

 

i tried doing

... Read More
132 Views
4 Replies

You can try this script

 

Get-MsolUser -All |Where-Object {$_.UserPrincipalName -like "*centricaplc.onmicrosoft.com" -and $_.isLicensed -eq $true } |Export-csv c:\support\c
... Read More
Best Response

You are comparing against a "domain" property, which does not exist. Try something like this instead:

 

Get-MsolUser -All | ? {$_.UserPrincipalName.Split("@")[1] -eq "centr

... Read More

I got this from someone, and for Albania it works like it should. But if i change to for example Germany as country, it gets text and not the correct dates in the date collum.  I see that with Germany and some other countries also have a publicholiday and

... Read More
74 Views
2 Replies

 Try below script and it will work more most country Like USA,INDIA,germany but it will not work for albania.

 

$uri = 'http://www.officeholidays.com/countries/usa/index.ph
... 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
116 Views
2 Replies

We use PSScriptAnalyser with custom rules and Pester Unit tests. On commit to GIT we check that Test are good and Code Coverage is high. Check out any of Microsoft DSC Re

... Read More
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

Hello

I have a windows PowerShell Script that I made to move a folder to anther folder on the same drive. (move-item 'E:\System State Folder' 'E:\Backup Folder') Action : Start a Program, Program/script: PowerShell, Add arguments: -ExecutionPolicy Bypass,

... Read More
171 Views
6 Replies

And you might also need to run the script as administrator. In any case, add some logging/debugging capabilities in the script in order to troubleshoot it properly.

Read More

how to i add export command to the below script

 

$siteURL = "https://litwareinc.sharepoint.com/sites/finance"
$x = Get-SPOSiteGroup -Site $siteURL
foreach ($y in $x)
    {
        Write-Host $y.Title -ForegroundColor "Yellow"
        Get-SPOSiteGroup -Site
... Read More
148 Views
6 Replies

Try this script

 

$siteURL = "https://litwareinc.sharepoint.com/sites/finance"
$x = Get-SPOSiteGroup -Site $siteURL
$GroupList = @()


foreach ($y in $x)
    {
       
    
... Read More

How about:

 

($siteURL = "https://litwareinc.sharepoint.com/sites/finance"
$x = Get-SPOSiteGroup -Site $siteURL
foreach ($y in $x)
    {
        Get-SPOSiteGroup -Site $sit
... Read More
Best Response

You might want to give a bit more detail on what you are trying to do? Do you want to export the output to an .txt file?

I have a powershell script that loops a fileshare and reports the properties of all the files.

This part reports to a .txt file:

Get-ChildItem -Recurse $source |  ?{-not $_.PSIsContainer} | ForEach-Object {Audit-File $_} | Sort-Object fullname | Select Full
... Read More
156 Views
4 Replies

Try this script for output with txt file

 

$Details=Get-ChildItem -Recurse $source |  ?{-not $_.PSIsContainer} | ForEach-Object {Audit-File $_} | Sort-Object fullname | Sel
... Read More
Best Response

Use the -Encoding parameter with Export-CSV, it works just fine. For example:

 

Export-Csv -NTI blabla.csv -Encoding Unicode

Disclaimer - Limited Powershell experience and new to the community

 

We've developed a script that runs on our local machines that pull O365 audit logs using the commandlet Search-UnifiedAuditLog 

Our local machines have:

Windows 10 64 bit with Powershell 5 

... Read More
149 Views
3 Replies

The cmdlet is loaded via Remote PowerShell, so nothing specific is needed on the machine. Are you actually able to connect to SCC PowerShell on said machine? Can you use

... Read More
Best Response

Hi Team ,

 

I need immediate help in getting the tutorial for course number - 6434 (Automating Windows Server 2008 Administration with Windows PowerShell) , exam reference number - 83-640 .

 

I know this course has been retired . But I wanted to learn .

 

Pleas

... Read More
79 Views
1 Reply
This is a great, FREE intro to PowerShell By Jeffery Snover and Jason Helmick https://mva.microsoft.com/en-US/training-courses/getting-started-with-microsoft-powershell-8276

... Read More

I found a very good article on Powershell which will give us the complete idea to automate certain things in Active Directory .

 

To know more details , check this link .

 

https://mva.microsoft.com/en-us/training-courses/using-powershell-for-active-directory-8397?l=iUERrJJz_7204984382#

... Read More
96 Views
0 Reply

Hi

 

I need to move data from one attribute to another on a user object in Active Dirctory.

 

Today the attribute homePhone is porpulated with users private mobile number. I need to move this to otherMobile.

 

First I try to do this on my own account this way:

$

... Read More
152 Views
4 Replies

Hi
Otherhomephone is multivalue attribute so that it is not working and you can try below script

$users = get-aduser -Filter * -Properties *|Where-Object {$_.otherhomePhone
... Read More
Best Response

Please use the below script and check.

 

$users = get-aduser -Filter * -Properties *|Where-Object {$_.homePhone -ne $null }| Select-Object Samaccountname,homePhone

foreach
... Read More