HPlum78
Members-
Posts
1,530 -
Joined
-
Last visited
Content Type
Forums
News
20th
EduGeek EDIT Conference
Blogs
Everything posted by HPlum78
-
Free School Meals Email - Anyone had it yet?
HPlum78 replied to mitchell1981's topic in General Chat
The function below essentually redeems the vouchers from the codes that they send over in the CSV file (if that's how you are manging it) function Create-GiftCard{ [CmdletBinding(DefaultParameterSetName='Parameter Set 1', SupportsShouldProcess=$true, PositionalBinding=$false, HelpUri = 'http://www.yourhelppage.sch.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){ 'HEA'{ $FirstName = 'Sch1' $LastName = 'Academy' $eMailAdd = '[email protected]' $ScheMailAdd = '[email protected]' $Phone = '0111234789' $MPhone = '07959123789' } 'BAB'{ $FirstName = 'Sch2' $LastName = 'Academy' $eMailAdd = '[email protected]' $ScheMailAdd = '[email protected]' $Phone = '01162123123' $MPhone = '07959123789' } 'LAN'{ $FirstName = 'Sch3' $LastName = 'Academy' $eMailAdd = '[email protected]' $ScheMailAdd = '[email protected]' $Phone = '0111234789' $MPhone = '07959123789' } 'WOO'{ $FirstName = 'Sch4' $LastName = 'Academy' $eMailAdd = '[email protected]' $ScheMailAdd = '[email protected]' $Phone = '0111234789' $MPhone = '07959123789' } }#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 Enter-SeUrl -Driver $driver -url $EVBaseUrl # setup Selenium driver and load inital FSM site $driver = Start-SeFirefox Enter-SeUrl -Driver $driver -url $EVBaseUrl # Added this to account for the queue on the redemtion phase of the process, that said it a quick fix and needs to really carry the cookies into the # next iteration. This will avoid having to enter the queue on each pass. $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 $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 $elementOnPage = $Null } Else{ Start-Sleep -Seconds 3 write-host -fore Cyan "Script is not armed, code will not be redeemed" Stop-SeDriver $driver $elementOnPage = $Null } })} This is designed for my better 1/2 multi academy trust so they can select the school that is redeeming the voucher and it fills out the info on the Edenreds pages also lets you select any of the vouchers that are being offered. This could be refactored to take a CSV file with a list of parents/ carer info rather than having it delivered to a school address. Dont know why the code keeps getting mashed.... -
Yeah I ain't saying that they would not love to kill it as an OS but they would also rather burn in hell than let data center hardware not have an MS OS sat on it! (or at least an option)
-
Free School Meals Email - Anyone had it yet?
HPlum78 replied to mitchell1981's topic in General Chat
Rearrange this well known phrase or saying 'poor pi55'! As for asking not to overload the system is this really acceptable? If they are that busy then there is the ability to automatically scale up and out these days or if you are not using a cloudy supplier for hosting your front end or don't want to cover the cost put a virtual queue in place, if you need me I will be over here smashing my face into the wall! -
Hmm @mavhc not sure that's the case, I was listening to the Azure guys (think it was at tech summit) and they accept that there is a need for hybrid deployments and these will be around for some years. Also when I was talking with Jeff Snover (not so long ago) about the serves OS roadmap he said there are plans at least to ~2026.
-
I am with @chaplic on this and mirror's my previous posts on this very question on here. If its greenfield site it would take something big in the world to persuade me to have an on prem AD deployment these days (coming from someone who loves AD) seems strange me advising not to have an on prem directory. But hay the world has changed so must I... Anyhow ADFS v Azure auth is now really not a thing (again love me an ADFS farm!) just take a cloud first approach and make the argument for on prem is what I would say in your position.
-
Free School Meals Email - Anyone had it yet?
HPlum78 replied to mitchell1981's topic in General Chat
It's a poor do for a company that is going to be essentially mass mailing not to have those records in place, also looking at the whole process there seems to be to many parts that require a soft mussy bags of organs (human) intervention. They need to get on it pronto. Maybe someone in the IT department needs to take a look at MX toolbox and use the spf/ dmarc record creator tools and checkers! -
Bank Holiday weekend! - What is everyone up to?
HPlum78 replied to hardtailstar's topic in General Chat
We are all going out to the seaside, well its the kids sandpit in thr back garden :-p -
Free School Meals Email - Anyone had it yet?
HPlum78 replied to mitchell1981's topic in General Chat
@Edu-IT Yeah mailed as in posted! Too many data issues but I have had a few CFOs saying the same data is not reliable enough (even after a recent data sanitising process at one school!) problem is you cannot force people to keep there info up to date... -
So during this time of distance working (and well even when all this madness ends) take a look https://findtime.microsoft.com It's a utility/ plug in for O365 and Outlook that makes scheduling meetings across companies and people easier. Take a look not going to guarantee that it will be available to you all mind....
-
- 1
-
-
Free School Meals Email - Anyone had it yet?
HPlum78 replied to mitchell1981's topic in General Chat
As with the Tesco EV site, i have written a PowerShell script (well function) that connects to the site using the codes they supply selects the voucher fills out all the details on the site then the voucher is mailed to a mail that is setup so that someone can mail them out (this is due to the data, as others have found sending out codes and emails that are in your MIS systems may mean that someone else get a ~£30 voucher, hence the reason that they want them mailed out!) happy to share if anyone needs a similar solution. -
Newbie setting up Microsoft Teams for a college - Teams or Channels?
HPlum78 replied to BJG's topic in How do you do....it?
@BJG I work in a Uni and this for my sins this is one of the areas I am involved in and have developed over the past 18 months or so, if you want some insights and want to go over the whole life cycle management piece then PM me I am happy to go over what we have done/ demo what we have in place. To sum up we use our ticketing system and users can request a team via the our helpdesk (they have to select what the team is for and select what the data category is based on the guide lines set out by our information security office (as certain data is not permitted in our Teams service - clinical trial data is one of these)) then we use Flow and PowerShell scripts to create the Team assign owners/ users and make sure that it meets the naming conventions and the likes. We also have scripts that check the Teams meet the criteria after they are created so for instance they have a minimum of 2 owners and some other bits that we keep a check on so that the Teams don't just stagnate over time, a number of people in the department spent a few weeks with the product group from MS developing our Teams service. So as for what makes a Team well they can follow the departmental or college structure but they are also good for those Teams that span across departments and colleges that's why we have ultimately let users control and drive the usage of Teams, we just have a service and lifecycle wrapper for it. -
Free School Meals Email - Anyone had it yet?
HPlum78 replied to mitchell1981's topic in General Chat
Nah TheManFromIT is the head teacher :-p -
Free School Meals Email - Anyone had it yet?
HPlum78 replied to mitchell1981's topic in General Chat
Also going to the email address that the DFE have on file so you best get that dug out. The individual schools not the MAT so if you have a number of schools you are going to need the DFEs mail address for each of your schools. -
Free School Meals Email - Anyone had it yet?
HPlum78 replied to mitchell1981's topic in General Chat
They only started getting them out at just after 20:00hrs yesterday.... -
One thing I will say if you do $userlist = import-csv ,instead of using $userlist | foreach-object use $userlist.foreach(). This is because they have done a load of work under the hood to improve the speed (.Net team have to be more accurate..)
-
Yeah just checking where I need to start, let me throw something together....
-
First question I have is are you able to connect to your tenant? Second have you got a test group?
-
I love me a PowerShell, a lot some might say.... Before I roll my sleeves up and sink my arms into this particular script can you just tell me why?
-
Yeah they they had looked at that very solution but it would not have helped them in this instance anyhow. Everything became a little pressing....
-
So this will get you the server name:- $str = '\\Server-01\Documents\User\Documents' $StrServer = $Str.TrimStart('\\').Split('\') $StrServer[0] H.
-
So the wife has been asked to sort out vouchers (Tesco in this case) for all the free school meal students in the schools within her MAT, Tesco do have a solution that essentually allows you to mail the vouchers to a mail address. There are a number of issues with this first one being the data held for mail address in their systems is well interesting at best and a large portion have no mail address at all. Tesco do offer a service to post out the cards as well but this can take between 3 and 5 days (and for lots of reasons right now will not even guarantee that). From the CSV file they provide you can go to a link for each voucher and print it yourself, now anyone care to guess how this would take for ~1000 vouchers? as you can imagine its no small amount of time (she got it down to ~3 mins a voucher) so to save her having to spend the next couple of days and the RSI I wrote the following PowerShell Script:- $Files = gci 'C:\Users\MP\Desktop\Tesco\EV_CSV\' | select FullName $TEVData = Import-Csv $Files.FullName $TEVBaseUrl = 'https://www.giftcards.tescoforbusiness.com/gift-card/view/' $TEVData | % { $TokenUrl = $TEVBaseUrl + $_.Token $TokenCC = $_.'Challenge Code' $PNGSaveFldr = "C:\Users\MP\Desktop\Tesco\Images\$($_.OrderNumber)\" $PNGFileName = $_.Token +'.PNG' $driver = Start-SeFirefox Enter-SeUrl -Driver $driver -url $TokenUrl $element = Find-SeElement -Driver $driver -id 'id_value' Send-SeKeys -Element $Element -Keys $TokenCC Send-SeKeys -Element $Element -Keys ([OpenQA.Selenium.Keys]::enter) Start-Sleep -Seconds 2 $screenShot = Invoke-SeScreenshot -Driver $driver Save-SeScreenshot -Screenshot $screenShot -Path $PNGSaveFldr$PNGFileName -ImageFormat Png Stop-SeDriver -Driver $driver Clear-Variable driver } So I am using the Selenium module (Install-Module Selenium) to do the work here (I would have liked to use an API and did take a look for a RESTful API but at first glance could not see that this was an option for the Tesco voucher site) and you will need FireFox installed on your computer (although Selenium has got the option to fire up other browsers (use get-command -module selenium for the full list of supported browsers)) First thing to do is get the csv(s) from the Tesco dashboard and change the $Files directory to that location, then the only other thing is to change where the image is saved ($PNGSaveFldr) is the var for that (what i have done is added the order number to Tesco's csv) so that if like in my case you have a load of different orders the image file is saved in a folder that matches that order number. After running the script you end up with a png file for each of the urls that Tesco send you, from there you can print the vouchers out. I am sure that this can be mangled to be used for any voucher sites, if needs be ask and i will help. Hope this helps someone out. H.
-
post a few examples of the paths please.
-
Coronavirus: General discussion (see opening post for rules)
HPlum78 replied to Dos_Box's topic in General Chat
My wife has said at the rate they are going it looks like they will have more pupils in school on Monday than at any other time! Apparently one of the pupils who has been signed up will increase their attendance by 100% just by turning up on Monday... -
Coronavirus: General discussion (see opening post for rules)
HPlum78 replied to Dos_Box's topic in General Chat
My place has essentially shutdown so working from home ish now although connectivity issues have made that interesting for me today. I have carved out a place for me to work and the wife has picked her spot we are far enough away from each other to hopefully avoid ending up in the court house if we both get to the other side of this! I will add this, a large portion of my family work in the NHS (sisters, aunts, uncles. Who have their own families) at all levels and in all posts and at no point have any of them said that they will not put themselves in harms way to help the people who need them most, when they most need it. I think its incumbent on anyone who is able to help them in any way we can while they busy saving people. This means they need someone and somewhere safe to take their kids while looking after other people's families. Closing schools will not help them do that, they cannot do that from home! The government needs time to swing into action and schools will close but they need time to get other things in place. Do what you need to stay safe guys and girls but spare a thought for those people on the front line of this and if you are able and willing, help where you can. -
Bulk Create Distribution Lists With Members
HPlum78 replied to kidpressingbuttons's topic in Office Software
I guess this may be a better question, what permissions do you have to give the account that runs the integration so that it can access your users colanders? also how long dose it take to sync your time tables?
