Jump to content

pfl

Members
  • Posts

    43
  • Joined

  • Last visited

Reputation

162 Excellent

About pfl

  1. My first port of call would be to note the time of when these applications close and cross match them with the times in event viewer on the machine, look at the Application events and see if anything is shown around the time, It will give you an event ID which will help you troubleshoot why they are closing / crashing
  2. pfl

    Bye bye Replit

    Now that firewalledreplit has been broken for over 2 weeks im intrigued in how other people have implemented python in their school environment. I'm tempted to go down the route of an immutable VM but we still have hardware that will struggle, has anyone managed to get this working in Windows Sandbox? What's the prefered IDE to use? Thanks
  3. I'm sure I created an example of reading/ writing and appending to files in replit before.... it was a while ago ... let me see if i can find it... https://replit.com/@Mr-PP5/Writing-to-a-text-file#main.py This is from 2 years ago to show the reading and writing of files in an online ide There's some good examples I create a while ago how to interact with sql lite which our ICT teaching staff used for their lessons
  4. If you want to split the document at every header 1 and use the header as the fileneame but also want to include the table under each header 1, use the following (This has been tested with a simple table & header 1 text): Sub SplitDocumentByHeading1() Dim originalDoc As Document Dim newDoc As Document Dim para As Paragraph Dim rng As Range Dim title As String Dim saveFolderPath As String ' Set the folder path to save the new documents saveFolderPath = "\\SAM-FS-02\staffhome$\jwalsh\MCAS\" ' Set the original document Set originalDoc = ActiveDocument ' Loop through each paragraph in the document For Each para In originalDoc.Paragraphs ' Check if the paragraph is a Heading 1 If para.Style = "Heading 1" Then ' Get the Heading 1 text as the document title ' Set the header range starting from the paragraph Set headerRange = para.Range ' Extend the range to include the entire header content headerRange.Expand Unit:=wdParagraph Set tableRange = headerRange.Next(wdTable) ' Copy the header range headerRange.Copy ' Create a new document Set newDoc = Documents.Add newDoc.Range.FormattedText = para.Range.FormattedText ' Copy the table range tableRange.Copy ' Paste the table into the new document Set newdocrange = ActiveDocument.Content newdocrange.Collapse Direction:=wdCollapseEnd newdocrange.Paste ' Set the range to include the entire new document Set rng = newDoc.Range ' Find and remove the page breaks in the new document With rng.Find .Text = "^m" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Execute Replace:=wdReplaceAll End With ' Save and close the new document in the specified folder with the title as the file name title = Split(para.Range.Text, vbCr)(0) For i = 1 To Len(StrNoChr) title = Replace(title, Mid(StrNoChr, i, 1), "_") Next title = title & ".docx" newDoc.SaveAs2 saveFolderPath & title, FileFormat:=wdFormatDocumentDefault newDoc.Close ' Reset the range to the original document Set rng = originalDoc.Range End If Next para ' Clean up objects Set newDoc = Nothing Set originalDoc = Nothing ' Notify the user when the splitting process is complete MsgBox "Document has been split by Heading 1." End Sub
  5. Please can you try the following (the below worked for me, When the save dialog failed I noticed it was passing the vbcr in the filename - below gets rid of it, also you were missing the trailing '\' in your folder path) Note - All this does is split the document at the Paragraph 1 formating, saves it as a new document with the paragraph 1 filename including the paragraph 1 text in the newly saved split document): Sub SplitDocumentByHeading1() Dim originalDoc As Document Dim newDoc As Document Dim para As Paragraph Dim rng As Range Dim title As String Dim saveFolderPath As String ' Set the folder path to save the new documents saveFolderPath = "\\SAM-FS-02\staffhome$\jwalsh\MCAS\" ' Set the original document Set originalDoc = ActiveDocument ' Loop through each paragraph in the document For Each para In originalDoc.Paragraphs ' Check if the paragraph is a Heading 1 If para.Style = "Heading 1" Then ' Get the Heading 1 text as the document title ' Create a new document Set newDoc = Documents.Add newDoc.Range.FormattedText = para.Range.FormattedText ' Set the range to include the entire new document Set rng = newDoc.Range ' Find and remove the page breaks in the new document With rng.Find .Text = "^m" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Execute Replace:=wdReplaceAll End With ' Save and close the new document in the specified folder with the title as the file name title = Split(para.Range.Text, vbCr)(0) For i = 1 To Len(StrNoChr) title = Replace(title, Mid(StrNoChr, i, 1), "_") Next title = title & ".docx" newDoc.SaveAs2 saveFolderPath & title, FileFormat:=wdFormatDocumentDefault newDoc.Close ' Reset the range to the original document Set rng = originalDoc.Range End If Next para ' Clean up objects Set newDoc = Nothing Set originalDoc = Nothing ' Notify the user when the splitting process is complete MsgBox "Document has been split by Heading 1." End Sub
  6. The LastWriteTime should be correct, I found an example that I have slightly modified to traverse a directory of subfolders and files displaying all results in a two column table ("Full Name, Last Write Time") I've set my time ranges to be in months, only displaying files and folders that are older then 30 months but less than 60 months (AddMonths can be changed to other increments if needed eg AddYears,AddDays or AddHours) $table_properties = @{Expression={$_.Fullname};Label="Full Name";width=195}, @{Expression={$_.LastWriteTime};Label="Last Write Time";width=350} Get-ChildItem -Path 'c:\temp\' -recurse -Filter *.* -include *.* | ? {$_.LastWriteTime -lt (Get-Date).AddMonths(-30) }| ? {$_.LastWriteTime -gt (Get-Date).AddMonths(-60)} | Sort-Object -Property LASTWRITETIME -Descending | Format-Table $table_properties Don't forget to change the path 'C:\temp\' its just an example path i used for testing.
  7. I can confirm this running powershell with -version 2 (which is the lowest version the parameter will go down to) shows the errors you are seeing. Running the above on powershell 5 or 7 works correctly. There are examples of version 1 form timers but i would try and stay away from them and try and concentrate moving away from windows vista.
  8. This is due to mixing BAT commands and VBS, the ECHO command on your line 7 (Which creates the VBS script) gets broken as soon as it sees the quotation marks which makes & vbCrLF break. using the ^ character before every quotation and & escapes the character allowing the ECHO command to pipe it into the VBS file correctly. The below is what you are looking for. @echo off SETLOCAL SET _prompt=%1 ::Create the VBS script with an echo statement: ECHO Wscript.Echo Inputbox(^"Please select^" ^& vbCrLf ^& ^"1. Email backup^"^& vbCrLf ^& ^"2. Document backup^"^& vbCrLf ^& ^"3. Offsite backup^"^& vbCrLf ^& ^"4. System File check %_prompt%^",^"Utilities Menu^")>%TEMP%\~input.vbs :s_GetInput :: Run the vbScript and save the output FOR /f "delims=/" %%G IN ('cscript //nologo %TEMP%\~input.vbs') DO set _string=%%G :: Delete the VBS file DEL %TEMP%\~input.vbs if '%_string%'=='1' goto 1 if '%_string%'=='2' goto 2 if '%_string%'=='3' goto 3 if '%_string%'=='4' goto 4 if '%_string%'=='' goto end :1 start "" "E:\My Documents\Downloaded\Programs\Securityemail.exe" goto end :2 start "" "E:\My Documents\Downloaded\Programs\securitycopy.exe" goto end :3 start "" "E:\My Documents\Downloaded\Programs\SecureOffsite.exe" goto end :4 start "" "E:\My Documents\Downloaded\Programs\SFCProc.exe" goto end :end Let me know if this helps Thanks
  9. Unfortunatley the above doesn't work for us, Students here are assigned a chromebook and utilise on-site and off-site filtering which is provided by an extension. For this extension to work our web filter / proxy has a separate network to allow this extension to work and to also segregate the traffic from our internal traffic. Chromebooks are usually given a managed network at device level but the student with assigned chromebooks also need this other ssid so their assigned chromebooks filter correctly, trouble is these students have the tendancy to not bring their devices in so end up using classroom devices which means the user assigned managed network profile follows them on to these class devices, no matter what form of ssid blocking I use at device level the user based cloud policy always overrides this. If there was a setting for changing conenction priority or if the setting for ssid bloacking was set at device level and enforced at device level (instead of user session based) this would solve the above issue. Thanks
  10. @jthompson Even stranger This bug post (The last post) https://bugs.chromium.org/p/chromium/issues/detail?id=837205 "2) user vs device -> all network settings you can modify on the Networks page under "General settings (Chromebook only)" are per-device, including the new block list for wifis. They are part of the GlobalNetworkConfiguration type (https://chromium.googlesource.com/chromium/src/+/main/components/onc/docs/onc_spec.md#globalnetworkconfiguration-type if you want to read the details), which is present for the device policy only. You can not specify that list as per-user restriction. You should set these values on OUs that contain devices." Indicates that yet again this is a device setting EDIT: updated bug url https://issuetracker.google.com/issues/256513725 Also displays the block SSID setting is device level although the posts above do show it as being applied at user level only Wish i didn't even start looking at this now! https://chromium.googlesource.com/chromium/src/+/main/components/onc/docs/onc_spec.md#globalnetworkconfiguration-type GlobalNetworkConfiguration type The GlobalNetworkConfiguration contains settings which apply to all of the networks that the device may connect to. The client supports this only in device-level policy; the client-side ONC validator fails if it appears in user policy. To avoid bricking devices, these policies will only be enforced in user sessions. The login screen ignores these policies and may still be used for fetching new policy or logging in. A Help Center article warns admins of the implications of mis-using this policy for Chrome OS. So if the above is correct my understanding is , Yes its device level settings BUT only enforced in a user based session (surely this is classed as "User Policy"?) My question is... why does my black listed SSID still allow connection due to it being allowed at user policy level. What i thought was a simple solution to a problem we had is now causing me a headache! All i want to do is block an SSID for an OU ! (im actually considering collating a list of mac addresses and creating a deny ACL on our SSID - might cause me less stress then these gsuite policies!)
  11. Thats what i thought BUT the blocked ssid setting has a header "General settings (Chromebook only)" which to me indicates device settings? Edit: Maybe i jumped the gun in thinking this was device only , especially with chromebook only being specified, it might just mean Chromebook "User" setting only.
  12. Hi all, Just after some advice, we have a wireless network configured at user level for BYOD devices what I would like to do is block this wireless network for a certain OU Using the global network config i have added the SSID to the blocked SSID list and can see this being applied at device level to the chromebook, unfortunatley (I believe due to policy overrides) the user policy for the network is applied and the SSID can be connected to on a device in the OU where the blocked SSID is being applied. https://support.google.com/chrome/a/answer/9037717?hl=en details the order of policy settings being applied. I can see on the chromebook the policy for the blocked ssid is set as "Source = Cloud, Applies to = Device, Level = Mandatory" When the settings are exported as a JSON and viewed I can also see the user level network being applied as well. Source = Cloud, Applies to = User, Level = Mandatory. My order of policy application is set as default (which is Machine > machine cloud > OS user > Chrome profile) How can I make my device level SSID blocking over ride the user setting? From my understanding anything set at device level shouldn't be overwritten by the user policies? Just for testing purposes I added my mobile hotspot SSID to the blocked list and that worked but this was not a managed network set at user level. Any help would be appreciated. Thanks Edit: Ive now tested my SSID connecting from the login screen where no user policies are being applied so only device level setting should be set at this level, it still lets me connect to the blacklisted SSID even though its no longer a "Managed" network, the blocking of SSID is done via string to Hex and ive reversed the hex i can see in the JSON and it converts back to the correct SSID. Oddly even though blocked SSID setting is device only it only applies once a user is logged in, my hotspot only gets blocked when a user logs in, my needed blocked SSID still does not get blocked.
  13. Does anybody know the built in url for instigating chromes "inspect" element? With wild card blocking right clicking and inspecting a page does not work (im guessing its a url block) Dev tools is enabled and I can get inspect to work while url blocking is in place I can view any errors in realtime. Thanks
  14. Thanks again, that is a new list that i have not seen but unfortunaltey all those URLs I have already added, my exception list is now growing very big!
  15. Thanks for the reply, after reading my post i now realise it was poorly explained. I want to only allow students access to google apps with no other access to any other website or URLs Ive managed to partially achieve this by wildcarding ("*") the setting for blockedurls at the device level and then excepting the needed google urls But its messy, im still hitting hurdles with some signin screens being blocked.
×
×
  • Create New...