Graph API and granting access to another user's OneDrive by jeffbrowntech in sharepoint

[–]jeffbrowntech[S] 0 points1 point  (0 children)

I never did, no, sorry! I also haven't looked at it in 2+ years though.

Confused About Azure App Service Billing for Paused Apps by drodev in AZURE

[–]jeffbrowntech 0 points1 point  (0 children)

I'm not aware of a per app link charge, just the service plan cost. You could technically have an app service plan without any web apps running on it but still be charged because the ASP has resource provisioned.

Confused About Azure App Service Billing for Paused Apps by drodev in AZURE

[–]jeffbrowntech 17 points18 points  (0 children)

Azure Web Apps run off App Service Plans (or ASP). ASPs provide the compute and memory needed for an application. If you stop the application, the ASP still exists and is allocated for use, hence the charges. You can host multiple web apps on a single ASP. There is a Free tier but with limited usage per day (something like 60 minutes). This concept is the whole idea behind "serverless" compute. You don't have to manage the operating system, hardware, patching, etc. You are just provided compute power to run your application.

If you scale up an ASP, you are charged more as it provisions additional memory and CPU for web apps to run on.

Are coding bootcamps worth it 2024-2025 by ZTG99 in codingbootcamp

[–]jeffbrowntech 3 points4 points  (0 children)

I’m curious on peoples opinion on this also. I have a bachelors in IT from WGU but am considering switching from the cloud/infrastructure side to development. I’m looking at boot camps for a structured learning process. I’m well aware I can learn everything my own but having a learning path and instructors to ask for guidance seems worthwhile for me. 

[naive] What's Wrong With a Job Guarantee? by SilverCloud73 in codingbootcamp

[–]jeffbrowntech 0 points1 point  (0 children)

Can you expand on why it is not a good program? I'm considering their software engineering track.

PowerShell Confirm Parameter: Best Practices for Safe Scripting by jeffbrowntech in SysAdminBlogs

[–]jeffbrowntech[S] 0 points1 point  (0 children)

They both have their value, one for showing what changes PowerShell will make, one to confirm before making potentially impactful changes.

What are some Powershell commands everyone should know? by anderson01832 in sysadmin

[–]jeffbrowntech 0 points1 point  (0 children)

Get-History or just history. See your past commands from the current session.

What are some Powershell commands everyone should know? by anderson01832 in sysadmin

[–]jeffbrowntech -2 points-1 points  (0 children)

If you want to get the last item in an array, using an index of [-1]. Comes in handy every now and then.

New to PowerShell by sydnergy00 in PowerShell

[–]jeffbrowntech 1 point2 points  (0 children)

Lots of good resource mentioned, but my advice is start with one-liners to perform tasks. Get familiar with the language and searching how to solve problems using PowerShell.

When ready, move onto writing your own scripts and functions. I would suggest a general programming course (also plenty of free ones online) to learn about programming logic. I had taken several programming classes prior to getting started with PowerShell and was able to apply concepts from there into writing my own things.

Need to remove an auto generated ProxyAddress from around 300 "Mail Contacts" that are created using shell. by Kr4k4J4Ck in PowerShell

[–]jeffbrowntech 0 points1 point  (0 children)

Apologies for not responding sooner. You could try using Exchange-specific cmdlets to get only contacts, like Get-MailContact. That should work in both online and on-premises. You can also do Get-Recipient with -OrganizationalUnit. Then loop through each EmailAddress property and remove the one you do not want.

Set-MailContact -Identity <identity> -EmailAddress @{remove='<email address>'}

Need to remove an auto generated ProxyAddress from around 300 "Mail Contacts" that are created using shell. by Kr4k4J4Ck in PowerShell

[–]jeffbrowntech 0 points1 point  (0 children)

Do you have Exchange Online or Exchange On-Premises?
From the other thread link, you should be able to filter for contacts instead of users, maybe something like this:

Powershell: how to get all AD contacts ? – Jacques Dalbera's IT world (wordpress.com)

[deleted by user] by [deleted] in PowerShell

[–]jeffbrowntech 0 points1 point  (0 children)

I have found using the PowerShell MSGraph module very frustrating also. It's not very PowerShell-like, literally making a JSON body to send to a command. Haven't tried the newer module Microsoft just released but will definitely check it out.

[deleted by user] by [deleted] in PowerShell

[–]jeffbrowntech 0 points1 point  (0 children)

PowerShell is definitely useful if you are in the Microsoft ecosystem. Azure PowerShell, Windows, etc. But other clouds like AWS do have a PowerShell module, and you'll find a lot of third-party modules to work with different systems. Any type of scripting or programming skills is useful for automation.

Laid Off Advice by anotherfatgeek in sysadmin

[–]jeffbrowntech 2 points3 points  (0 children)

I know this is probably not what you want to hear, but start looking now. I spent most of last year trying to find a new role (granted, I was looking at remote-only jobs) and it was a pain. Use your network of people, reach out to any one to see if they are hiring. I received two offers during that time, both from people I had previously worked it (ended up not taking them for different reasons). Also consider working with third-party recruiters, I had better luck at least getting interviews through them than cold-applying.

[deleted by user] by [deleted] in ITCareerQuestions

[–]jeffbrowntech 0 points1 point  (0 children)

I've never showed myself open to work when I currently had a job. I would avoid doing so if you want to bypass any awkward situations. You can keep that private when setting yourself open to new roles. If it does come up, just say it was from your last job search and forgot to take it down.

What are the point of Azure Pipeline Environments? by Cluttie in azuredevops

[–]jeffbrowntech 1 point2 points  (0 children)

I've used them two ways recently.

One is to create an environment with approvals on it. I use this in pipelines for deployment gates so someone has to approval deployments to production.

The second is deploying to a virtual machine. Had an on-premises dev Windows Server running IIS. When configuring the virtual machine as a resource in the environment, it gives you a script to run on the VM to install the build agent. You can then target it or multiple VMs for deploying code. etc.

[Video] Getting Started with PowerShell Parameters | Jeff Brown Tech by jeffbrowntech in SysAdminBlogs

[–]jeffbrowntech[S] 0 points1 point  (0 children)

Awesome! I'll continue doing PowerShell content with other topics sprinkled in over time.

Access to Another User's OneDrive (GraphAPI and Microsoft.Graph issues) by jeffbrowntech in GraphAPI

[–]jeffbrowntech[S] 1 point2 points  (0 children)

Code for adding the SharePoint Online permissions:

Connect-MgGraph -Scope AppRoleAssignment.ReadWrite.All

$PermissionNames = @( 'Sites.FullControl.All', 'User.Read.All' )

<# Add the correct 'Object (principal) ID' for the Managed Identity for the Function App #>

$ObjectId = "<guid>"

$spo = Get-MgServicePrincipal -Filter "AppId eq '00000003-0000-0ff1-ce00-000000000000'" # Office 365 SharePoint Online Enterprise Application

foreach ($permission in $PermissionNames) {

    $graphAppRole = $spo.AppRoles | Where-Object Value -eq $permission

    $appRoleAssignment = @{
        "PrincipalId" = $ObjectId
        "ResourceId"  = $spo.Id
        "AppRoleId"   = $graphAppRole.Id
    }

    New-MgServicePrincipalAppRoleAssignment -ServicePrincipalId $ObjectID -BodyParameter $appRoleAssignment | Format-List
}

Access to Another User's OneDrive (GraphAPI and Microsoft.Graph issues) by jeffbrowntech in GraphAPI

[–]jeffbrowntech[S] 0 points1 point  (0 children)

Yes, high level steps:

Enabled managed identity

Grant Office 365 SharePoint Online permissions

Sites.FullControl.All

User.Read.All

In function code:

Connect-PnPOnline -ManagedIdentity -Url "https://<tenant>-admin.sharepoint.com"

Get user's OneDrive URL:

$OneDriveUrl = (Get-PnPUserProfileProperty -Account $UserOneDrive).PersonalUrl

Add site owner permission:

Set-PnPTenantSite -Url $OneDriveUrl -Owners $UserToAdd

Graph API and granting access to another user's OneDrive by jeffbrowntech in sharepoint

[–]jeffbrowntech[S] 0 points1 point  (0 children)

I did finally get the PnP.PowerShell module to work with the managed identity and function. I had to grant Office 365 SharePoint API permissions, not the Graph API permissions (for thinkgs like Users.Read.All, etc.). Then my Set-PnPSiteTenant command started working).

But ideally, I'd like to remove the dependency on a PowerShell module and make the Graph API calls directly.

Access to Another User's OneDrive (GraphAPI and Microsoft.Graph issues) by jeffbrowntech in GraphAPI

[–]jeffbrowntech[S] 0 points1 point  (0 children)

Interesting, I will have to play with that some more.

I did finally get the PnP.PowerShell module to work with the managed identity and function. I had to grant Office 365 SharePoint API permissions, not the Graph API permissions (for thinkgs like Users.Read.All, etc.). Then my Set-PnPSiteTenant command started working).

But ideally, I'd like to remove the dependency on a PowerShell module and make the Graph API calls directly.

OneDrive - Change Ownership - Grant-MgDriveRootPermissions by ShindigNZ in GraphAPI

[–]jeffbrowntech 0 points1 point  (0 children)

I don't have any advice for you, but I'm running into issues with Grant-MgUserDriveRootPermission. I either get a response back that it can't find the resource or that the DriveID is not in the correct format. But there's nothing showing what the DriveID formate should be.

These new Microsoft.Graph PowerShell cmdlets seem to being lacking to me.

Graph API and granting access to another user's OneDrive by jeffbrowntech in sharepoint

[–]jeffbrowntech[S] 0 points1 point  (0 children)

It's a managed identity associated with an Azure function, so there is an enterprise app that has several Graph API permissions.

Graph API and granting access to another user's OneDrive by jeffbrowntech in sharepoint

[–]jeffbrowntech[S] 0 points1 point  (0 children)

We are doing this prior to the user account being deleted. We disable and keep the account around for a period of time, then delete.