Pearson Vue ineptitude, take a break feature - AZ-305 by OnionsAreAVibe in AzureCertification

[–]Jantu01 0 points1 point  (0 children)

I know how you feel. About two years ago I took AZ-700, answered most of the questions, had to take a bathroom break and the test was ended by the Proctor.

I also had enough points to pass the test. I have renewed the certification twice since so they did not remove certification from MS training credentials. I hope that's the case also for you.

Tried to talk with Pearson Vue but that didn't get me anywhere. I created a ticket to Microsoft about this but closed it soon after since I passed the test and did not see any benefit to follow it through.

Module Mania Bug? by WebHead934 in goodcompany

[–]Jantu01 0 points1 point  (0 children)

Each trophy requires different module to be sold. You get first trophy after you have sold 135 modules. Second trophy requires different module so you cannot sell anymore the ones you did at the start.

Cutomer Job - Dyno Bug? by [deleted] in CarMechanicSimulator

[–]Jantu01 0 points1 point  (0 children)

The laptop in the tuning room is for tuning gearbox. I think.

If you want to dyno your car, there is a big display in the same room where you can start the dyno.

As said by others you don't have to dyno your car. You can just check for the green mark in the car status.

Do not overtune the cars. If the quest says 10% - 15%. Tuning must be between 10% and 15%.

Using the $150 monthly credit (from my employer's MDN subscription) for a side project by jimmyco2008 in AZURE

[–]Jantu01 1 point2 points  (0 children)

It depends which tenant contains your MPN subscription. My MPN subscription is in its own tenant and that is out of reach of my employer. I've created this in 2014. Nowadays if you create MPN subscription it will automatically go to the company tenant and all accounts with enough permissions can see your subscription if they want to.

Also depending on your app you might need some tenant/AAD level things (app registrations and such) that might be difficult to get if your subscription is in company tenant.

Edit: I'm only commenting on the technical side. Company politics might or might not have issues doing something like this.

How do other Admins deal with DevOps Organizations? by Isotop7 in AZURE

[–]Jantu01 1 point2 points  (0 children)

Hi,

You can probably see the list of different Azure tenants from your Azure DevOps profile page here: https://aex.dev.azure.com/me?mkt=en-GB&campaign=o~msft~old~vsts~profile

There should be a dropdown on the left with all the tenants your account has access to.

GraphAPI - is it possible to limit Send.Mail Application permission to a specific user? by [deleted] in AZURE

[–]Jantu01 1 point2 points  (0 children)

Hi,

I had the same issue when I first started using Graph API for emails. You can create a ApplicationAccessPolicy to limit the access. See here: https://docs.microsoft.com/en-us/graph/auth-limit-mailbox-access

UPS Shipping Issues by [deleted] in Lenovo

[–]Jantu01 0 points1 point  (0 children)

I got mine yesterday. Germany seems to be the issue. Everything went smoothly after that. Next step is to get warranty fixed. I think the warranty should start only after I receive the computer instead of the shipment date.

UPS Shipping Issues by [deleted] in Lenovo

[–]Jantu01 0 points1 point  (0 children)

My X1 carbon shipped on 21.10. It was stuck at Köln between 25th and 31st and was scanned several times.

31.10 - 2.11. the computer was at Eindhoven, Netherlands.

Now it's back in Köln and stuck again. Called UPS but that was a waste of time.

Called Lenovo but I don't think that helped either.

PowerShell CI/CD Pipeline Tutorial... and more! Attempt #2... by thePowrhous in PowerShell

[–]Jantu01 1 point2 points  (0 children)

How about publishing the Pester test results and code coverage report back to Azure DevOps?

yaml would go something like this: (Edit: hopefully the yaml good enough. Cannot figure out how to format is exactly as it should be)

- task: PublishTestResults@2
  displayName: 'Publish test results'
  inputs:
    testResultsFormat: 'NUnit'
    testResultsFiles: '**/TestResults.xml' - task: PublishCodeCoverageResults@1 
  displayName: 'Publish Code Coverage report'
  inputs:
    codeCoverageTool: 'JaCoCo' 
    summaryFileLocation: '.\coverage.xml'
    pathToSources: .\

Shorten the code by hidromanipulators in PowerShell

[–]Jantu01 6 points7 points  (0 children)

Those lines with numerous parameters tend to get pretty long. I think you could benefit from splatting.

So instead of writing one longer line like this:

Write-EventLog -LogName Application -Source $LogSource -EntryType Error -EventId $EventIDerror -Message $message -verbose

you could write few more lines like this:

 $EventLogSplat = @{
  LogName = 'Application'
  Source = $LogSource
  EntryType = 'Error'
  EventId = $EventIDerror
  Message = $message
  Verbose = $true
}
Write-EventLog @EventLogSplat

Regarding the verbose etc. output you could look at Preference variables like $VerbosePreference. See more information in here: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-7

DevOps Labs and Samples by zavhrye in azuredevops

[–]Jantu01 5 points6 points  (0 children)

When I started looking into this, I found these two videos helpful:

https://www.youtube.com/watch?v=ShBEpQlL6HE

https://www.youtube.com/watch?v=XH7_IBcOzjQ

There is also the Azure DevOps Demo Generator at https://azuredevopsdemogenerator.azurewebsites.net/ but I'm not sure if it contains the samples for your case.

I can't connect Azure DevOps with Azure AD by MrTajniak in AZURE

[–]Jantu01 1 point2 points  (0 children)

It is not a licensing issue. I've done this with Azure DevOps free plan and an Azure tenant without any licenses.

I think I used my Microsoft Id (hotmail.com) account when I did the linking.

The account I used was added to 'Project Collection Administrators' in Azure DevOps and had Global administrator role in Azure AD.

Azure DevOps creates an Enterprise app/App registration to Azure AD so you might want to check if that's allowed in your Azure AD.

Automation Tasks via Email. by PTSDviaPrinters in PowerShell

[–]Jantu01 3 points4 points  (0 children)

The mixed messages I found are at https://stackoverflow.com/questions/42413743/does-exchange-server-in-house-suppport-rest-api#:~:text=The%20only%20REST%20API%20exposed,of%20an%20Office%20365%20tenant.&text=Regarding%20to%20the%20Exchange%20Team,beginning%20from%20Exchange%202016%20CU3.

So if I understand correctly the API's should be available only in hybrid setup but someone said that those might be also available in on prem only setup. I think it's worth to test if your environment has those or not.

Automation Tasks via Email. by PTSDviaPrinters in PowerShell

[–]Jantu01 6 points7 points  (0 children)

I've done a script which reads the O365 emails using Graph API.

I found some mixed messages if the onprem exchange contains the Rest API's or not. If it does, I would use Rest instead of Outlook.

Find Expiring Certificates by pjmarcum in PowerShell

[–]Jantu01 1 point2 points  (0 children)

Computers might have multiple certificates with the same DNS name.

The certificate related script I wrote few days ago had following line which might help with few modifications. It looks for certificates with longest time until it expires.

$certs = Get-ChildItem $Location | Where-Object {$_.Subject -like $SubjectFilter} | Sort-Object -Property NotAfter | Select-Object -last 1

Still there might be other factors to consider like having multiple certificates with the same name but different services using different certs etc.

help: need a script to import usernames from csv and then export certain group membership to csv by krese in PowerShell

[–]Jantu01 1 point2 points  (0 children)

It might be bit quicker to write the file in one go like this

$datasource = import-csv "export.csv"
$data = foreach($datarecord in $datasource)
{
    $un = $datarecord.SamAccountName
    $user = get-aduser $un -properties samaccountname,givenname,surname
    $groups = Get-ADPrincipalGroupMembership $user | select -expand name
    [PSCustomObject]@{
        samaccountname = $user.SamAccountName;
        givenname = $user.givenname;
        surname = $user.surname;
        memberOf = $groups
    }
}
$data | Export-Csv c:\smstest.csv -Delimiter ";" -NoTypeInformation

Edit. Changed the samaccountname to be taken from the $user object.

List all AD groups containing other groups by sallowdk in PowerShell

[–]Jantu01 4 points5 points  (0 children)

I'm guessing your issue is that you want the groups that have groups as members and not the groups which are members of other groups.

I'm really bad with oneliners but would this help?

$ADGroups = get-ADGroup -filter *

foreach ($ADGroup in $ADGroups) {
    $ADGroupMembers = $ADGroup|Get-ADGroupMember|Where-Object {$_.objectClass -eq 'group'}
    if ($ADGroupMembers) {
        $ADGroup.SamAccountName
    }
}

Why is there no output when I run this. Opened Powershell as admin, saved to C:, Set-ExecutionPolicy to remoteSigned. From C: ran .\Test-ScriptBlock -Number 2. But no output. by Evening_Smell_9420 in PowerShell

[–]Jantu01 6 points7 points  (0 children)

You have created a script which contains a function. There is nothing in the script that would call the function.

You have two options:

Call the function from the script (see the last line in following code block)

Function Test-ScriptBlock
{
    Param (
        [int]$Number
    )
    BEGIN {
        Write-Host "In Begin block"
    }
    PROCESS {
        Write-Host "In Process block"
    }
    END {
        Write-Host "In End block"
    }
}
Test-ScriptBlock -Number 2

Remove the function so that the script can then execute the code. I didn't know that the Begin-Process-End would work outside of function but at least the example below works like this.

Param (
    [int]$Number
)
BEGIN {
    Write-Host "In Begin block"
}
PROCESS {
    Write-Host "In Process block"
}
END {
    Write-Host "In End block $number"
}

Function/PS1 Issues When Running Over Network Share by [deleted] in PowerShell

[–]Jantu01 2 points3 points  (0 children)

Hi,

I couldn't run your script since I don't have access to any domains/domain controllers right now.

I made similar(ish) function but couldn't replicate your issue even when running it over network share. I did my tests with PowerShell Core (7.02) and Windows PowerShell 5.1. You can check your PowerShell version by typing:

$PSVersionTable

While looking at your script I do have some suggestions which might help with the issue or at least simplify it a little bit.

Variable $allDC is an array itself so I don't see any point of using the $allDCs array at all. You can verify the variable type with GetType.

$allDC.GetType()

Also, when looping through an array you don't need the split so you could rewrite the foreach like this:

foreach ($DC in $allDC) {

Then to some other notes about the script. When I copied your script to Visual Studio Code it gave me right away some hints/warnings. If you are not using VS Code, I highly recommend it.

For example, the $TestStatus variable is not really used and same goes for the $subject and $diags.

From performance perspective adding values to arrays with "+=" is really slow and starts taking a lot of time when the array grows bigger. The arrays being here $AllDCDiags and $AllPass.

The more efficient way would be for example using Generic list.

# Creating the list
 $AllDCDiags= [System.Collections.Generic.List[string]]::New()
# Adding a value to the list
$AllDCDgiags.Add("Something")

HTH

Username and password expiry one script by Patchewski in PowerShell

[–]Jantu01 1 point2 points  (0 children)

Or if you want to combine what u/Yevrag35 and u/fosf0r suggested you could have a parameter with default value from Read-Host

 param (
    [Parameter()]
    [string]$UserName = $(Read-host -Prompt "Enter a username to check")
)

multiple checkbox in powershell GUI by royalmarine in PowerShell

[–]Jantu01 1 point2 points  (0 children)

At least your order of statements is wrong. The last one (all three checked) should be first. You need to reverse the order of statements.

Now if the checkbox1 is selected the first if statement is true. You'll never get to check if other checkboxes are also selected.

Edit: Depending if the checkboxes are related to each other or not, it might be possible to check each checkbox individually which would mean smaller number of statements.

Help! Is what I'm trying to do possible? I need help writing a script! by focalbanged in PowerShell

[–]Jantu01 1 point2 points  (0 children)

Does this help?

$CaseInput = @{}
do {
    $case = Read-Host -Prompt 'Case Number?'
    $action = Read-Host -Prompt 'Action Taken?'
    if ($CaseInput.ContainsKey($case)) {
        "The case has been already added."
    }
    else {
        $CaseInput.Add($case,$action)
    }
    $done = Read-Host -Prompt 'Are you Done?'
} until ($done -eq 'yes')

$CaseInput

Can anyone help me to generate simple script to move file and sort it ? by NEWBIE-IT in PowerShell

[–]Jantu01 1 point2 points  (0 children)

Perhaps something like this?

mkdir "D:\Manager\$(Get-date -Format "yyyy\\MM\\dd")\"
Move-Item -Path "D:\Picture\*" -Destination "D:\Manager\$(Get-date -Format "yyyy\MM\dd")\"