HPlum78
Members-
Posts
1,530 -
Joined
-
Last visited
Content Type
Forums
News
20th
EduGeek EDIT Conference
Blogs
Everything posted by HPlum78
-
It's lazy if you have got the skills to write some of the software that we use and then not supply a modern way to manage identities and sign ins within that software there is no excuse.
-
@pvalentim so I have took a real quick look at the code you are using and a couple of things spring to mind (I am not answering your question directly re 17 users then stopping) I am an advocate of try/ catch blocks, these are important especially if you are taking an action (so try{ ipmo teams } catch{ write-log-error failed to import module}) the problem with the code that you have posted is that you have try/ catch blocks but are not doing anything in the catch. You need to catch whatever happens/ does not happen in try else you may as well not have the try/ catch block in the first instance. The next thing that sticks out is one thing I wish could be un-invented write-host, the whole reason to script is so that you can fire and forget or schedule it to run write-host has no use when you start using scripts like that "in space no one can hear you scream" comes to mind. Good for a dirty way to debug but outside of that it should be cast from your scripts. (I will point you at Don Jones tweet him write-host and see how he replies, he and Jeff Snover have had some interesting and lively debates on this over the years :-P). I have posted a function on these forums in the past that essentually allows you to log info/ warnings and errors and will out them to the screen (if being run interactively) or to a file, you should use something like that in the catch parts of your try/ catch blocks. This may well give you some insights into why only 17 users are being added to your teams (So I may have answered you question indirectly). One other thing, this is another around script automation and that is $cred = Get-Credential nothing wrong with this outside of automation but when you come to automation that needs addressing, I will post some of my thoughts and options around how you can deal with credentials in scripts.
-
Yeah the config for this is from the old version of IIS and I have been caught out with that same issue more than once... in fact i have just added our data centre subnets to the allowed list in the config and then decided to manage what is allowed into the box using Windows Firewall so I don't have to remember to do just that, also I have multiple nodes behind a Load Balancer so each change was multiple changes to the backend nodes (and no PowerShell!).
-
oh i see so not leaving the IIS box...
-
Yeah @Katy during the initial push to lock down I recall MS saying that they added ~88K servers to the teams infrastructure (from memory) the provisioning issue using the beta endpoints was due to them squeezing that beta api service resource wise and giving it to the production api service (they do cover that off in the service offering documentation for the api service) so those that leverage the beta service could/ would have hit provisioning stalls due to resource constraints. Don't forget that the teams service is not the same as the service that you hit when you are provisioning your teams you are hitting the graph API service. I will point you guys at the link below, as I will reiterate if you can leverage the graph API directly (not just for your trams work) then you will unlock a load of goodness.... I know that this is a little more dev than just using the PS commands but you have already chosen to use PS so using the graph API is just the next step and is just a next step in using PowerShell to automate the world. https://docs.microsoft.com/en-us/graph/teams-concept-overview
-
https://docs.microsoft.com/en-us/exchange/mail-flow-best-practices/how-to-set-up-a-multifunction-device-or-application-to-send-email-using-office-3 So you need opt 3 as you want to send to external rcpts
-
I have a change for this very service to go live next week, have you setup any connectors in exchange online? How are you accepting SMTP submissions on you box un auth and authenticate?
-
Oh and just a side note you can install the new beta module 1.0.22 that still supports -template parameter. Need to register the PSGalleryInt repo:- Register-PSRepository -name PSGalleryInt -SourceLocation https://poshtestgallery.com/
-
Ah just seen that the beta endpoint has had its limits altered so that may explain why you are hitting the throttle limits using the 0.9.6 module.
-
That error there @Katy is you hitting your tenant wide limit for calls into the graph API service. You should look at trapping the http response retry-after and backing off your requests until the time specified. This will get you back more quickly than a sleep because if you hit the service again it adds toward your limit even if no action is taken due to you being throttled. Again something that you can handle better if you leverage the underlying graph API, I would like to know what you are doing to hit the throttle limit as I bet we hit the service a lot more than most. In fact this here will give you better guidance:- https://docs.microsoft.com/en-us/graph/throttling
-
hmm yeah interesting that they have removed some of the functionality when they come out of the beta module, I can see why and this is down to the graph API version that is used in the background. I would say try your hand at using PowerShell and graph API calls to create and manage your teams, and when possible try to use the GUIDS that represent your users as this offers some big performance improvements.
-
Not sure of Activelearn but Clickview supports SAML (or better put did when I set it up)
-
azure ad sync Can it write back into Activedirectory?
HPlum78 replied to chazzy2501's topic in Cloud Services
PTA stands for Pass-though authentication -
[ms office - o365] SSSO and Office 365
HPlum78 replied to kidpressingbuttons's topic in Office Software
SSO is not the same as password sync (or more accurately password hash sync). SSO in summary is a method of signing in once and then not having to reauth. -
I deal with this for around ~40 such applications, it's not as easy to say vote with your feet as the others in the market place also don't have a solution for user management from an embellished claim. But in saying that all the ones that do not, do support some other way of sending identity information and this is taken care of by other means of integrations (ftp, API, to name a couple) these also come in a few flavours as well those that will mange delta updates and those that will not (full load). All this does is make more work for us but that's what we get paid the big bucks for! A day in IT Services is like a day on the farm. Every meal a banquet, every pay check a fortune. I love IT Services. :-)
-
Free School Meals Email - Anyone had it yet?
HPlum78 replied to mitchell1981's topic in General Chat
Nice something else to add! Would need to check that the xpath's have not been changed due to that. (although in my mind that would make no sense) but never say never. Will update the script to account for additional shops and repost shortly. Thanks @Edu-IT (I think) :-P -
Free School Meals Email - Anyone had it yet?
HPlum78 replied to mitchell1981's topic in General Chat
Code un/de-mashed! function Create-GiftCard { [CmdletBinding(DefaultParameterSetName='Parameter Set 1', SupportsShouldProcess=$true, PositionalBinding=$false, HelpUri = 'YourDomain.ac.uk', ConfirmImpact='Medium')] [Alias()] [OutputType([string])] Param ( # School Name [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true, ValueFromRemainingArguments=$false, Position=0, ParameterSetName='Parameter Set 1')] [ValidateNotNull()] [ValidateNotNullOrEmpty()] [ValidateCount(0,5)] [ValidateSet("SCH1", "SCH2", "SCH3", "SCH4")] [Alias("SchName")] $SchoolName, # Voucher Partner [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true, ValueFromRemainingArguments=$false, Position=0, ParameterSetName='Parameter Set 1')] [ValidateNotNull()] [ValidateNotNullOrEmpty()] [ValidateCount(0,10)] [ValidateSet("JohnLewis", "MnS", "ASDA", "Morrisons", "Sainsburys" , "Tesco")] [Alias("EVPar")] $EVPartner, # File Path [Parameter(Mandatory=$true, ParameterSetName='Parameter Set 1')] [AllowNull()] [ValidateScript({ if(-Not ($_ | Test-Path) ){ throw "File or folder does not exist" } if(-Not ($_ | Test-Path -PathType Leaf) ){ throw "The Path argument must be a file. Folder paths are not allowed." } if($_ -notmatch "(\.csv)"){ throw "The file specified in the path argument must be a csv" } return $true })] [system.IO.FileInfo]$FilePath, # Armed [Parameter(Mandatory=$false, ParameterSetName='Parameter Set 1')] [bool]$armed ) Switch ($SchoolName){ 'SCH1'{ $FirstName = 'SCH1' $LastName = 'Academy' $eMailAdd = '[email protected]' $ScheMailAdd = '[email protected]' $Phone = '01112123123' $MPhone = '07908854409' } 'SCH2'{ $FirstName = 'SCH2' $LastName = 'Academy' $eMailAdd = '[email protected]' $ScheMailAdd = '[email protected]' $Phone = '01112123123' $MPhone = '07908854409' } 'SCH3'{ $FirstName = 'SCH3' $LastName = 'Academy' $eMailAdd = '[email protected]' $ScheMailAdd = '[email protected]' $Phone = '01112123123' $MPhone = '07908854409' } 'SCH4'{ $FirstName = 'SCH4' $LastName = 'Academy' $eMailAdd = '[email protected]' $ScheMailAdd = '[email protected]' $Phone = '01112123123' $MPhone = '07908854409' } } #Get .CSV data $EVData = Import-Csv $FilePath #URL for FSM codes $EVBaseUrl = 'https://www.selectyourcompliment.co.uk/dfe' $EVData.ForEach({ $code = $_.Code $code = $code.TrimStart("=",'"') $code = $code.Trimend('"') #Write-Host -fore green $code # setup Selenium driver and load inital FSM site $driver = Start-SeFirefox Enter-SeUrl -Driver $driver -url $EVBaseUrl $elementOnPage = $false do{ $element = Find-SeElement -Driver $driver -XPath '//*[@id="wrapper"]/div/div/div/div/div/div/div/div[1]/div[1]/div/form/div[1]/input' if(Find-SeElement -Driver $driver -XPath '//*[@id="wrapper"]/div/div/div/div/div/div/div/div[1]/div[1]/div/form/div[1]/input'){ $elementOnPage = $true } } while($elementOnPage -eq $false) Start-Sleep -Seconds 3 # Find the 'enter unique code' element on the initial page $element = Find-SeElement -Driver $driver -XPath '//*[@id="wrapper"]/div/div/div/div/div/div/div/div[1]/div[1]/div/form/div[1]/input' # This sends the code that is fromthe CSV file downloaded before and sends the enter key press Send-SeKeys -Element $Element -Keys $code Send-SeKeys -Element $Element -Keys ([OpenQA.Selenium.Keys]::enter) # PageLoad after accepted code - click the overlay button 'Start Shopping' $element = Find-SeElement -Driver $driver -XPath '//*[@id="overlay"]/div/div[2]/button[1]' Invoke-SeClick $element # Need to wait for the page to load (could do with a better way to deal with this but for testing this will do) Start-Sleep -Seconds 3 Switch ($EVPartner){ 'JohnLewis'{ $elementJL = Find-SeElement -Driver $driver -XPath '//*[@id="Container"]/div/div/div[3]/div[4]' Invoke-SeClick $elementJL #MNS Reward popup - enter Value and Add to basket $elementPUJLVal = Find-SeElement -Driver $driver -XPath '//*[@id="inputValue"]' Send-SeKeys -Element $elementPUJLVal -Keys '30' $elementPUJLATB = Find-SeElement -Driver $driver -XPath '/html/body/div[5]/div/div/div[2]/div[2]/form/div[3]/div/button[2]' Invoke-SeClick $elementPUJLATB # Need to wait for the page to load (could do with a better way to deal with this but for testing this will do) Start-Sleep -Seconds 3 } 'MnS'{ $elementMNS = Find-SeElement -Driver $driver -XPath '//*[@id="Container"]/div/div/div[3]/div[5]' Invoke-SeClick $elementMNS #MNS Reward popup - enter Value and Add to basket $elementPUMNSVal = Find-SeElement -Driver $driver -XPath '//*[@id="inputValue"]' Send-SeKeys -Element $elementPUMNSVal -Keys '30' $elementPUMNSATB = Find-SeElement -Driver $driver -XPath '/html/body/div[5]/div/div/div[2]/div[2]/form/div[3]/div/button[2]' Invoke-SeClick $elementPUMNSATB # Need to wait for the page to load (could do with a better way to deal with this but for testing this will do) Start-Sleep -Seconds 3 } 'ASDA'{ #Select ASDA $elementASDA = Find-SeElement -Driver $driver -XPath '//*[@id="Container"]/div/div/div[3]/div[6]' Invoke-SeClick $elementASDA #Asda Reward popup - enter Value and Add to basket $elementPUASDAVal = Find-SeElement -Driver $driver -XPath '//*[@id="inputValue"]' Send-SeKeys -Element $elementPUASDAVal -Keys '30' $elementPUASDAATB = Find-SeElement -Driver $driver -XPath '/html/body/div[5]/div/div/div[2]/div[2]/form/div[3]/div/button[2]' Invoke-SeClick $elementPUASDAATB # Need to wait for the page to load (could do with a better way to deal with this but for testing this will do) Start-Sleep -Seconds 3 } 'Morrisons'{ #Select Morrisons $elementMorri = Find-SeElement -Driver $driver -XPath '//*[@id="Container"]/div/div/div[3]/div[7]' Invoke-SeClick $elementMorri #Morrisons Reward popup - enter Value and Add to basket $elementPUMorriVal = Find-SeElement -Driver $driver -XPath '//*[@id="inputValue"]' Send-SeKeys -Element $elementPUMorriVal -Keys '30' $elementPUMorriATB = Find-SeElement -Driver $driver -XPath '/html/body/div[5]/div/div/div[2]/div[2]/form/div[3]/div/button[2]' Invoke-SeClick $elementPUMorriATB # Need to wait for the page to load (could do with a better way to deal with this but for testing this will do) Start-Sleep -Seconds 3 } 'Sainsburys'{ # Select Sainsburys $elementSains = Find-SeElement -Driver $driver -XPath '//*[@id="Container"]/div/div/div[3]/div[8]' Invoke-SeClick $elementSains #Sainsburys Reward popup - enter Value and Add to basket $elementPUSainsVal = Find-SeElement -Driver $driver -XPath '//*[@id="inputValue"]' Send-SeKeys -Element $elementPUSainsVal -Keys '30' $elementPUSainsATB = Find-SeElement -Driver $driver -XPath '/html/body/div[5]/div/div/div[2]/div[2]/form/div[3]/div/button[2]' Invoke-SeClick $elementPUSainsATB # Need to wait for the page to load (could do with a better way to deal with this but for testing this will do) Start-Sleep -Seconds 3 } 'Tesco'{ #Select TESCO $elementTesco = Find-SeElement -Driver $driver -XPath '//*[@id="Container"]/div/div/div[3]/div[9]' Invoke-SeClick $elementTesco #Tesco Reward popup - enter Value and Add to basket $elementPUTescoVal = Find-SeElement -Driver $driver -XPath '//*[@id="inputValue"]' Send-SeKeys -Element $elementPUTescoVal -Keys '30' $elementPUTescoATB = Find-SeElement -Driver $driver -XPath '/html/body/div[5]/div/div/div[2]/div[2]/form/div[3]/div/button[2]' Invoke-SeClick $elementPUTescoATB # Need to wait for the page to load (could do with a better way to deal with this but for testing this will do) Start-Sleep -Seconds 3 } } #Checkout $elementCheckOut = Find-SeElement -Driver $driver -XPath '/html/body/div[3]/div/div[2]/div[1]/div/div/div/div[2]/div/div[1]/div[2]/form/div/div/button' Invoke-SeClick $elementCheckOut # Need to wait for the page to load (could do with a better way to deal with this but for testing this will do) Start-Sleep -Seconds 3 #Get form elements and fill out with vars $elementFirstName = Find-SeElement -Driver $driver -XPath '/html/body/div[3]/div/div[2]/div/div/div/div/div/div/fieldset/div/div[2]/basket/div/div/form/div[2]/div[2]/div[1]/div[1]/div[2]/input' Send-SeKeys -Element $elementFirstName -Keys $FirstName $elementLastName = Find-SeElement -Driver $driver -XPath '/html/body/div[3]/div/div[2]/div/div/div/div/div/div/fieldset/div/div[2]/basket/div/div/form/div[2]/div[2]/div[1]/div[2]/div[2]/input' Send-SeKeys -Element $elementLastName -Keys $LastName $elementEmail = Find-SeElement -Driver $driver -XPath '/html/body/div[3]/div/div[2]/div/div/div/div/div/div/fieldset/div/div[2]/basket/div/div/form/div[2]/div[2]/div[1]/div[3]/div[2]/input' Send-SeKeys -Element $elementEmail -Keys $eMailAdd $elementConfEmail = Find-SeElement -Driver $driver -XPath '/html/body/div[3]/div/div[2]/div/div/div/div/div/div/fieldset/div/div[2]/basket/div/div/form/div[2]/div[2]/div[1]/div[4]/div[2]/input' Send-SeKeys -Element $elementConfEmail -Keys $eMailAdd $elementPhone = Find-SeElement -Driver $driver -XPath '/html/body/div[3]/div/div[2]/div/div/div/div/div/div/fieldset/div/div[2]/basket/div/div/form/div[2]/div[2]/div[1]/div[5]/div/input' Send-SeKeys -Element $elementPhone -Keys $Phone $elementMPhone = Find-SeElement -Driver $driver -XPath '/html/body/div[3]/div/div[2]/div/div/div/div/div/div/fieldset/div/div[2]/basket/div/div/form/div[2]/div[2]/div[1]/div[6]/div[2]/input' Send-SeKeys -Element $elementMPhone -Keys $MPhone $elementDelDetails = Find-SeElement -Driver $driver -XPath '/html/body/div[3]/div/div[2]/div/div/div/div/div/div/fieldset/div/div[2]/basket/div/div/form/div[2]/div[2]/div[3]' Invoke-SeClick $elementDelDetails Start-Sleep -Seconds 3 if ($Armed){ $elementRedeem = Find-SeElement -Driver $driver -XPath '/html/body/div[3]/div/div[2]/div/div/div/div/div/div/fieldset/div/div[2]/basket/div/div/form/div[2]/div[2]/div[3]/div/button[2]' Invoke-SeClick -Element $elementRedeem write-host -fore green "Script is armed, Code Number $($Code) has been redeemed. The voucher will be delivered to the $($eMailAdd) address." Start-Sleep -Seconds 10 Stop-SeDriver $driver } Else{ Start-Sleep -Seconds 3 write-host -fore Cyan "Script is not armed, code will not be redeemed" Stop-SeDriver $driver } }) } So it uses the selenium driver (install-module -name selenium) and I have set it to use FireFox (both of those will be needed to run the script) this allows you take the delivery of the vouchers out of Edenred's hands and allows you to send them out. As noted loads could be done to automate the rest of the process. It has a param called -armed (a bool) by default its set to false so you can test the script with real codes safe in the knowledge that it will not redeem anything (after you are happy add -armed:$true)! You need to fill out/ remove the the school details as required (line 66). One last note this script was made to work before Edened put in the virtual queue on the redemption site, now I have come up with a really dirty solution to deal with this its around line 119 to 126 the do/ while. Problem is that this makes us sit in the queue on every iteration (far from ideal) what I (we) need to do is get the browser cookies and store them so they can be injected into the next iteration this in turn will stop us hitting the queue on each code that we are trying to redeem. Oh and one more more last one... I hate that I have had to use start-sleep to allow the page to load and such, I would like to do something more well better but time pressure has not allowed me to refactor those parts of the script I see code that looks like the do/ while loop for dealing with the queue looking for an element to load on the page before continuing rather than those start-sleep lines. -
@Norphy since server 2012R2 you can roll forward and back the forest and domain functional levels, that said I don't know that this has caused the issue that the op is experiencing. You could try rolling back using PS commands:- set-adforestmode set-addomainmode
-
I am going to point you at this:- https://docs.microsoft.com/en-us/exchange/mail-flow-best-practices/how-to-set-up-a-multifunction-device-or-application-to-send-email-using-office-3
-
A good course that I did recently (and have have been in this industry for well let's say a fair while) is this one :- https://cqureacademy.com/cyber-security-training/30-day-windows-security-crash-course But I suppose the question is where do you want to go? Is being a desktop/ all round admin what you see yourself doing or are you thinking of specialising? One thing I will say is learn >_ (PowerShell) look at Don Jones month of lunches books on PS also while talking of his books read his how to find a wolf in siberia. The above is my initial recommendations and these will not serve you wrong no matter where you are. hope this helps, take care all. H.
-
$user_ids.foreach({PS COMMAND -Identity $_ -OTHERPARAMS}) The foreach method is by far the best way to invoke looping in PS since PS V4 due to the work that the .NET team have done under the hood.
-
The reason I ask is a get-content is streaming in a file (I am assuming that the file contains a list of users?) then the next line uses that var in -Identity apart from the fact PS is saying don't pass me a Null value even if it ain't null that's going to throw an exception. Would need to use some kind of loop...
-
Personally I would use a group like @mdrabble has said or set an ext attrib on the accounts as you provision them from your identity management system then you can ripple a get-Aduser over AD. Loading out of a file adds a step thats not required and makes it difficult to run any kind of script that checks local users against synced users. That's said those type of scripts come over time.
-
What is in the var $user_ids
