Home

Windows PowerShell

71 Conversations

Latest Activity

Custom List Message Item

Hi. Im trying to create a script that loads users from an AD Group and filter them based on an attribute. My goal is to have a script that loads users from a group, finde the ones that do not have a mailbox in my exchange inviroment, and mail enable them.

... Read More
40 Views
2 Replies

Why don't you simply use the Exchange cmdlets for that? Get-Mailbox or Get-Recipient will do the tasks with ease.

 

And to answer the specific question about the cmdlet -

... Read More

I dont have access to AD right now, but i think you could do something like this. ! in front of $user.msExchMailboxGuid means that if the variable is null(empty), it shou

... Read More

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
1,063 Views
8 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

Is there a way to query out PS Remoting Client details (like hostname, IP address, etc.) via the script\advanced function that's exposed through the constrained endpoint?

The scenario is that a new Windows Server VM (that's not domain joined) need to conn

... Read More
38 Views
2 Replies

Well, depends on what you have configured for the endpoint. You might want to add some specific cmdlets to the session config file, such as Get-ComputerInfo. Or expose th

... Read More

PowerShell Core 6.0 is a new edition of PowerShell that is cross-platform (Windows, macOS, and Linux), open-source, and built for heterogeneous environments and the hybrid cloud.

 

First and foremost, thank you to all of our amazing community, especially

... Read More
581 Views
0 Reply

We are in the process of changing our backup software over to another client. In order for us to do this we need to make some changes to the user profile for chrome browser to enable SSO to work with this software.

 

We can get this to work with a powershel

... Read More
43 Views
1 Reply

Try this - put the script into a file  fixit.ps1 and then try this from cmd.exe:
powershell -executionpolicy bypass -file fixit.ps1

Upon testing the different Admin Roles with PowerShell, I came across the fact that a standard user can run a lot of Get-Msol Cmdlets. Is there something that I missed to block standard user's from being able to make a connection through Powershell to Azu

... Read More
147 Views
7 Replies

Keep in mind too that a typical OnPrem AD provides full read access to the same information to any standard user.

Um, that article is for Azure PowerShell, not Azure AD. You cannot restrict users from using the MSOL/AzureAD, unless you are willing to block other things as well (read:

... Read More
Best Response confirmed by Colton Lacy (Occasional Contributor)

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
2,060 Views
17 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

I have a script which I am creating a distribution list (New-DistributionList).  However, the format of the output gets screwed up when the following text appears:

 

New! Office 365 Groups are the next generation of  distribution lists.
Groups give teams sh
... Read More
177 Views
8 Replies

Could you post the script?

 

What you could do is to store the output in a variable, then output it with a small delay.

Looking for a (free?) GUI form frontend for scripts that I want to distribute to users.  

 

Basically, I want to gather three or four data points.... such as first name, lastname, domain name,  and country in a GUI form, which then passes these to parameter

... Read More
678 Views
8 Replies

You could use simple SPO form (custom list) , create a columns for:

 

  • first name
  • last name
  • Domain name
  • country

All data will be saved to this list and you can export

... Read More

If you're talking about reusable and repeatable, then ShowUI is an interesting choice.  Also, you can go native winforms.  PowerShell studio is a pay-for product, but rea

... Read More

PowerShell supports this natively, you can get the input directly as prompts in the script, or if you want you can build a real UI with buttons and other controls. An eas

... Read More

Hi all,

 

I have a SOAP request, the example is attached (SOAP body.txt).
And I figured out how to add all parameters to the body (New-WebServiceProxy.txt).
But no idea how to add security header with UsernameToken and Timestamp.

 

Thanks,

Tatiana

Read More
43 Views
0 Reply

I want to see which users are assigned admin role privileges in O365 for all admin role attributes.... Who can help me to get this report? 

 

 

98 Views
5 Replies

Hello Leighton Brunning,

 

If you are interested in GUI tool then the below tool has an in-built report for finding admin role privileges. (Once installed, navigate to 'R

... Read More

You are not being very specific here, but here's one of the snippets I use for reporting on Admin role assignments:

 

$roles = Get-MsolRole

$arrPermissions = @();$i=0;
f
... Read More

What does your current script look like?

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
3,762 Views
36 Replies

The answer is Yes, the new module released for Exchange Online also includes a connection string for accessing the Security and Compliance Center.

 Connect to Exchange Online PowerShell using multi-factor authentication

... Read More

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 confirmed by Robert Woods (Regular Contributor)

I created script below and I now want to enhance it as I am getting errors.

# Create the filename with the current date
$filename = ([string]::Format("\\JHBDSM020000128\QlikView\Elijah\Data\Detailed\128_Detailed_FileSystem_{0}.csv", (Get-Date).toString("yyy

... Read More
121 Views
1 Reply

You're problem has to do with the output width length.  By default, it is truncating due to its nature.  A better way is to use a format that preserves data.  Either clix

... Read More

We are in the process of changing our backup software over to another client. In order for us to do this we need to make some changes to the user profile for chrome browser to enable SSO to work with this software.

 

We can get this to work with a powershel

... Read More
56 Views
1 Reply

Maybe not the answer your looking for, but your security department are wrong and need to learn about real threats. An updated PowerShell engine provides way more securit

... Read More

Hi,

 

I have the following simple script that works fine, but continually loops once it has finished displaying the necessary information. Does anyone know what I need to change to get it to display the information only once?

 

import-csv .\MailboxUsersPermis

... Read More
82 Views
2 Replies

Your Get-Mailbox will be returning every mailbox in your org, and that will repeat for every $name that's in your mailbox user CSV list.

 

Looks like you should use "Get-Ma

... Read More

Hello,

 

I am new to power shell and i am trying to achive below. I have file test.txt with data as shown below.

i want the search for variable2 and update the value as below.

select * from table1 order by column

Can you please guide me on how to achive this?

 

... Read More
94 Views
2 Replies

How about this?

 

it will

  1. make temporary copy of the file (test.tmp)
  2. read the file line per line
  3. if the line starts with "variable2" (can contain whitespaces around), line con
... Read More

Do you need to run it in powershell trough a txt file or can you run it in a script?

 

You could take a look at this article on how to query SQL from PowerShell:
http://irisclasson.com/2013/10/16/how-do-i-query-a-sql-server-db-using-powershell-and-how-do-i-filter-format-and-output-to-a-file-stupid-question-251-255/

Read More

We have a group of admins that are also trusted to manage our customers through delegated administration.  How can I list all those admins? 

 

The closest I have come is:

 

Import-Module MSonline
$cred = Get-Credential
Connect-MsolService -credential $cred
$del
... Read More
77 Views
0 Reply

A few months ago, we started the journey to bring the PowerShell experience in to Azure Cloud Shell. Today, that experience enters public preview alongside Bash in Azure Cloud Shell.

 

With the addition of PowerShell in Cloud Shell, now you have the flexi

... Read More
156 Views
0 Reply

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
617 Views
7 Replies

I wrote a blog post in March on how to use task scheduler to run PowerShell scripts with arguments: https://www.andersrodland.com/powershell-script-with-arguments-as-a-scheduled-task/

Read More

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

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
110 Views
2 Replies

PowerShell Direct should help you do this. It allows you to run PowerShell from the host inside the VM guests. Windows 10 and/or Server 2016 is required.

 

https://blogs.technet.microsoft.com/virtualization/2015/05/14/powershell-direct-running-powershell-inside-a-virtual-machine-from-the-hyper-v-host/

Read More

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
384 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 confirmed by siva N (Occasional Contributor)

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
95 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
151 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 confirmed by Simon Wåhlin (MVP)

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
183 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 confirmed by pardeep soba (Occasional Contributor)

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

DGD_M-QXcAAbMoM.jpg

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