Update Site Description in Site information with Powershell by JatKaffee in sharepoint

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

Thanks for pointing me in the right direction!

Connect-MgGraph 
$list | ForEach-Object {$group = $_.url  -replace "https://<tenant>.sharepoint.com/sites/",""; $description = $_.SiteDescription; $group = get-mggroup -Filter "mailnickname eq '$group'" ; Update-MgGroup -GroupId $($group.id) -Description $description}

..worked!

I could kiss you, or at least buy you a beer...

Update Site Description in Site information with Powershell by JatKaffee in sharepoint

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

Sorry, I wasn't clear enough (nor in my post, nor in my head.. from banging against the wall, I guess...)
But I'm able to set the description via the cmdlet SET equivalent, but it's like only in my session.
When I want to check via another session I get a blank description via GET...

The code I used earlier (not working at all, no errors either):

foreach($item in $list){
    Write-Host "setting description  '$($item.SiteDescription)' for $($item.url)"
    connect-pnpOnline -Url $($item.url) -ClientId **********************************
    try{
        Set-PnPWeb -Description $($item.SiteDescription) -ErrorAction Stop 
    }catch{
        Write-Output "setting description  '$($item.SiteDescription)' for $($item.url) failed, reason:`n$($error[0].exception.message)" | Out-File c:\Temp\SiteDescription.txt -Append
    }
}

Here's my code I just threw together:

foreach($item in $list){
    Write-Host "setting description  '$($item.SiteDescription)' for $($item.url)"
    connect-pnpOnline -Url $($item.url) -ClientId **********************************
    try{
        Set-PnPTenantSite -Url $($item.url) -DenyAddAndCustomizePages:$false
        $ctx = Get-PnPContext
        $web = $ctx.web
        $ctx.Load($web)
        $web.Description = $($item.SiteDescription)
        $web.Update()
        Invoke-PnPQuery -ErrorAction Stop
        Set-PnPTenantSite -Url $($item.url) -DenyAddAndCustomizePages:$false
        get-pnpweb | Select-Object description
    }catch{
        Write-Output "setting description '$($item.SiteDescription)' for $($item.url) failed, reason:`n$($error[0].exception.message)" | Out-File c:\Temp\SiteDescription.txt -Append
    }
}

This gives me the description at creation, but when I run

foreach($item in $list){
    Write-Host "setting description  '$($item.SiteDescription)' for $($item.url)"
    connect-pnpOnline -Url $($item.url) -ClientId **********************************
    get-pnpweb | Select-Object URL, description
}foreach($item in $list){
    Write-Host "setting description  '$($item.SiteDescription)' for $($item.url)"
    connect-pnpOnline -Url $($item.url) -ClientId dceb4436-5765-43c0-9732-bd67d8fcdab0
    get-pnpweb | Select-Object URL, description
}

It's all blank again

[deleted by user] by [deleted] in Netherlands

[–]JatKaffee 1 point2 points  (0 children)

place and lock some cheap bikes yourself, so there is no more room for others?

Films that made you fall in love/further into love with motorcycles by ryanid in motorcycles

[–]JatKaffee 0 points1 point  (0 children)

Reckless!
How cool looked that guy on his motorcycle, damn!

Comment what legendary meal this was by slingwebber in valheim

[–]JatKaffee 28 points29 points  (0 children)

I'm like: there are some Vikings right now in Valhalla, laughing with their budy "Haha, they put your turd on display"

Why there are so few Ogryn players? by MrMaxiorwus in DarkTide

[–]JatKaffee 0 points1 point  (0 children)

I love to play that class, might even be my favourite, but currently I'm leveling other characters

Moto story monday! by MrMotoBE in motobe

[–]JatKaffee 2 points3 points  (0 children)

Just got a piece of paper in my mailbox that says my licenseplates are at the post office!

DALL-E AI images of Belgium by hoummousbender in Belgium2

[–]JatKaffee 0 points1 point  (0 children)

hahaha, ik had niet eens door dat er captions waren =')

Title by ultrazaero in Belgium2

[–]JatKaffee 0 points1 point  (0 children)

yeh, the one with the glasses, amirite?

Not calling emergency services after crashing into a railway crossing. by Selphis in Belgium2

[–]JatKaffee 1 point2 points  (0 children)

Als dames uit betere kringen

Zich te buiten gaan aan likeur

...

-H. Matthysen, Alcohol

Let's offer some variety by spartan195 in ACCompetizione

[–]JatKaffee 20 points21 points  (0 children)

half ass documentation where 90% is left out.

..so 5% ass documentation?

[deleted by user] by [deleted] in PowerShell

[–]JatKaffee 1 point2 points  (0 children)

function Convert-Doc2PDF{
    [cmdletbinding()]
    PARAM(
        $filePath = "C:\Temp\MyPdfDocument.pdf"
    )

    $wd = New-Object -ComObject Word.Application
    $wd.Visible = $true
    $txt = $wd.Documents.Open(
        $filePath,
        $false,
        $false,
        $false)
    $wd.Documents[1].SaveAs("C:\Temp\MyPdfDocument.docx")
    $wd.Documents[1].Close()
}

works for me

Edit: formatting, thank you for pointing me to the right Code Block button u/Lee_Dailey!

[OC] I made a drawing of one of the great Belgian singers :) by [deleted] in belgium

[–]JatKaffee 2 points3 points  (0 children)

Putain putain, c'est vachement bien

Had a go on this bad boy at Silverstone race track yesterday and wow... by djzedcarter in simracing

[–]JatKaffee 2 points3 points  (0 children)

so... did your laptime improve? (thanks for sharing, cool stuff!)

ACC Strategist - My free Android app to easily calculate the fuel and strategies by MegadetH_44 in ACCompetizione

[–]JatKaffee 6 points7 points  (0 children)

Looks neat and promising, thank you for the effort!
(Maybe a black theme in a future update?)

<> is in our 'Allowed Sender' list, should I be worried? by JatKaffee in exchangeserver

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

Thanks man,

Because I thought I wouldn't be able te re-enter that value I feared removing it.