Jump to content

HPlum78

Members
  • Posts

    1,530
  • Joined

  • Last visited

Everything posted by HPlum78

  1. From memory if you are using wps 5.1 or later do the following Set-ItemProperty 'HKLM:\System\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -value 1 That should fix the std cmdlet
  2. I think you can get a Kanban plugin for teams if you want to be digital or if not a board with sticky notes (brand neutral :-P) draw the outline of a Kanban board then just move the notes around...
  3. just to clear the Get-MailboxFolder -Identity username:\Calendar -Recurse command up that @sbrade47 suggested and what you have hit trying to use it, it does not allow admins to view other users folders. As per the following article https://docs.microsoft.com/en-us/powershell/module/exchange/mailboxes/get-mailboxfolder?view=exchange-ps So the behaviour you are experiencing @SimonInOz is correct, as others have said if its just for one users cal to allow access to another user just use the mgmt console and add the permissions from there (That coming from a >_ guy, never thought i would see the day! :-P). The cal will be presented to the user in their outlook client.
  4. Don't give up on PS just yet, it can be daunting but it's Power is in its versitility. Don Jones books on PowerShell in a month of lunches will go a long way to ease you in to PS.
  5. I don't make the rules I just write the code.....
  6. @sted you are indeed correct but has limited access on her laptop to add extensions to the browsers.... Also I write PowerShell! :-p
  7. The better 1/2 had been trying to search for information that had been released by the ESFA on the gov.uk site the only problem is that the search capability of the site is lets say a little user intensive! She was essentially opening each document! and then saving .... So I wrote this to help her out:- $links = ((Invoke-WebRequest -uri 'https://www.gov.uk/government/collections/skills-funding-agency-update').links | ? {$_.href -like "/government/publications/esfa*"}).href $links | % { $BaseFilter = $_ #write-host -fore Yellow $BaseFilter $WebUri = $_.replace("/government/publications/", "https://www.gov.uk/government/publications/") #write-host -fore green $WebUri $lnk = ((Invoke-WebRequest -uri $WebUri).links | ? {$_.href -like "*$($BaseFilter)*"}).href $lnk | % { if ($_ -Like "/government/publications/*"){ $PubUri = "https://www.gov.uk"+$_ $PubUri = $PubUri | select -Unique $PageContent = Invoke-WebRequest -Uri $PubUri $flName = $PubUri.Split("/") | select-object -Last 1 Write-host -Fore green "Got update from web address - copying content to $("$env:HOMEDRIVE\Desktop files\EsfaUpdate\$($flName).htm")" $PageContent.Content | Out-File "$env:HOMEDRIVE\Desktop Files\EsfaUpdate\$($flName).htm" } Else{ Write-host -fore Magenta $($_) "No valid content at this link" } } } It essentially grabs the content out of each document and saves it to the desktop in a folder called EsfaUpdate (you will need to make sure that folder is created!), you can then either use Windows search or as she has done import the files in to OneNote this has allowed her to search and annotate. Hopefully will help someone else out.
  8. The above from @noelmm would work but you really need to connect this up to your joiners/ movers / leavers process as this will determine who has what access to the folders during the life cycle of an identity (account) in your organisations. what i am saying is don't be manually managing CSV files for access to this. The real issue is that this should be in the application that HR use and that solution should be storing and managing access to this information as one mistake in the permissions and you could find that you are invited to a conversation!
  9. import-csv 'Z:\My Documents\Powershell\Misc Scripting Bits\names.csv' -OutVariable Fldr set-location 'Z:\My Documents\Powershell\Misc Scripting Bits\Folder creation Demo\' $Fldr.names | %{ new-item -name $_ -ItemType Directory } CSV looks like:- Names Harry Plum Isla Plum Michelle Plum Edith Plum Joel Plum Just looking at the error message the following is your initial code working:- ForEach ($folder in $Folders) { New-Item -name $folder.Names -itemtype directory } seems at first glance to be something to do with what is on/ expected on the pipe. If this is indeed the solution you go with I would add it to your identity management solution joiners process so that when your HR department create the record for a new member of staff then the folder creation is taken care of. This could also help you set the correct permission on the folders, as you could pull out the direct reports to from your HR system and use this information to manage those. While you are at it you could also pull out the department/ organisational unit from the HR system and put the next level of permissions on the folders as well.
  10. As @TechMonkey has posted will do the trick, I am still going to write the code to look for an event that is in the users calendar and then set the OoO based on that. Then users can be subscribed to the service via a group in AzureAD rather than by OU is my plan. This gives the user more control over the settings and also means that they don't have to contact IT for updates to the service (on that the above code would have to be customised for each user who wanted to consume the service). I will keep posting the code snippets as i am going along with a view to posting the whole script when it is done. The functions posted above will also help wrap a service around your tasks and scripts so outside of this will maybe help.
  11. The following will start PS as another users, so create your service account to run your Tasks/ PowerShell then run the code below to start a PS in the context of that service account. Then use the cred commands posted earlier to store the required creds for logging into your o365 tenant. <# .DESCRIPTION This function loads another powershell session in the context of another user This is to faciliate saving stored creds as that user for scheduled tasks etc .PARAMETER Cred the credential object for the other user .PARAMETER Elevate boolean - do you want the powershell session to be elevated - you should decide this based on whether the scheduled task will be set to run with highest privileges and this should only be done if there is an absolute requirement which needs this #> Function Invoke-UserContext { [CmdletBinding()] Param( [Parameter(Position=0,Mandatory=$true,ValueFromPipeline=$true)][system.Management.Automation.PSCredential]$Cred, [Parameter(Position=1,Mandatory=$false,ValueFromPipeline=$true)] [boolean]$Elevate = $false ) Write-Output $PSBoundParameters ### Check elevate parameter and setup verb as required if($Elevate){$verb="runas"} elseif(!($Elevate)){$verb="open"} try { Write-Output "Loading another PowerShell session in context of user: $($Cred.username). Verb = $verb" &Start-Process powershell.exe -Credential $Cred -NoNewWindow -ArgumentList "Start-Process powershell.exe -verb $verb" } catch { Write-Error -errorrecord $_ } }
  12. To help move this little project forward here is two functions that store credentials in a reg key <# .DESCRIPTION This functions creates a persistent credential supplied and saves it to the registry .PARAMETER Cred pre-populated credential object with username and password to store (these should be upn format) .PARAMETER RegPath The registry path to store the credential #> function Set-StoredRegCredential { [CmdletBinding()] Param( [Parameter(Position=0,Mandatory=$true,ValueFromPipeline=$true)] [system.Management.Automation.PSCredential]$Cred, [Parameter(Position=1,Mandatory=$false,ValueFromPipeline=$true)] [string]$RegPath = "HKCU:\Software\O365" ) Write-verbose "Storing credentials" try { New-Item $RegPath -force New-ItemProperty $RegPath -Name "username" -PropertyType String -Value $Cred.UserName -force New-ItemProperty $RegPath -Name "password" -PropertyType String -Value (Convertfrom-SecureString $Cred.Password) -force } catch [system.Exception] { Write-Error -errorrecord $_ #exit-script } } <# .DESCRIPTION This function retrieves the stored credential in the registry and passes it on to the calling object .PARAMETER RegPath The path in registry where the creds are stored #> function Get-StoredRegCredential { [CmdletBinding()] Param( [Parameter(Position=0,Mandatory=$false,ValueFromPipeline=$true)] [string]$RegPath = "HKCU:\Software\O365" ) if ($globaldomain){ $regpath = "$regpath\$globaldomain" Write-Output "Global domain override found regpath = $regpath" } try { Write-verbose "Obtaining Stored credentials" $storedpassword = (Get-ItemProperty -path $RegPath).password | ConvertTo-SecureString $storedusername = (Get-ItemProperty -path $RegPath).username if (-not($storedpassword) -or -not($storedusername)) { Write-Output "Couldn't retrieve stored credentials. Have they been set?" exit-script } return New-Object System.Management.Automation.PSCredential $storedusername, $storedpassword } catch [system.Exception] { Write-Error -errorrecord $_ #exit-script } }
  13. Speaking of requirements I have gone and solution-ised based on making the requirements up in my head and how I would approach it knowing that we use O365! If you don't then forget about voting it up and using my solution... And I will go back and read the initial post :-p
  14. What is needed is to be able to set the out of office based on an event in the users calendar, by the looks of it there is no option in outlook/ exchange to do this from a users prospective. There is a request for this functionality on the office 365 user voice so go there and vote it up so it gets put on the backlog. Outside of that you could get the user to put a calendar event in their cals and then use powershell to automatically set out of office based on finding an event in the users cal (use the graph API to do this). I will try to code this up but anyone could have a go at it, need to define the requirements of the cal event with the user so that you can identify the event in code. So subject of out of office automation would do. Then run the script at N interval to check/ update, enable/ disable out of office on the users mail box. You could also ask the user to put in the body of the event what the out of office message should say.
  15. It would be classed as personal data as you would be able to identify the individual. You are going to need consent for doing that and give your staff the ability to rescind that if they want to in the future (and remove their photo).
  16. I would powershell the grass out of that! No need to pay for something when you can just build it...
  17. https://support.microsoft.com/en-gb/help/2866345/ad-sysvol-version-mismatch-message-is-displayed-unexpectedly-in-the-gr Is it as simple as what is outlined above.
  18. As @TechMonkey has outlined, if you can absolutely avoid adding Domain Controllers as VMs in Azure I would, IaaS is where the costs are going to bite and is a bug bear when it comes to cloud consumption... If RDP to desktop is really a requirement then take a look here https://docs.microsoft.com/en-gb/azure/active-directory-domain-services/overview Also I think there is a azure windows desktop service (could still be in preview) look it up as from memory it cuts out some of the IaaS dependencies.
  19. If its greenfield then you should try to stick with a cloud only approach. Not sure that there is a requirement for any servers on prem or in cloud based on the above.
  20. https://products.office.com/en-us/where-is-your-data-located This will give you the info you need I think
  21. @mavhc makes more sense now you have said that.... @Arthur comments have covered my thoughts on this.
  22. I have a question about this who is connecting their users to a file share with an admin account or logging on to client computers as an admin? Or conversely connecting to a users file store logged on with an admin account? Also RDP from client computers to servers outside of IT Services and on data center network? Really?
  23. I am with @Steve21 here, you would not remove your North/ South firewall. So why would you remove your east/ west firewall? Its the only thing that will slow up the spread of malicious software/ code around your network (that and ACL's) I would think carefully before deciding to ditch it....
  24. Can you not just use Exchange for the purpose of room bookings? Room calendar and if needs be you can put some workflow is needed.
  25. If your not the owner of that calendar item then as you have noted you are only moving it in your personal calendar. I think if you have some delegate permission on the originators mailbox you would be able to update/ change the time on the calendar item....
×
×
  • Create New...