powershell script throwing errors
i have a script that when i run it it throws the following errorset-msoluserlicense : cannot bind argument to parameter 'userprincipalname' because it is null.at line:12 char:44+ ... set-msoluserlicense -userprincipalname $\_.userprincipalname -licens ...+                                             ~~~~~~~~~~~~~~~~~~~~    + categoryinfo         : invaliddata: (:) [set-msoluserlicense], parameterbindingvalidationexception    + fullyqualifiederrorid : parameterargumentvalidationerrornullnotallowed,microsoft.online.administration.automation.setuserlicensei am using the foreach cmd wrong?$1xyz = new-msollicenseoptions -accountskuid "1xyz:enterprisepack" -disabledplans forms\_plan\_e3,stream\_o365\_e3,deskless,powerapps\_o365\_p2,teams1,yammer\_enterprise,rms\_s\_enterprise,mcostandard,projectworkmanagement
#$entacctsku = get-msolaccountsku | where-object {$\_.skupartnumber -eq 'enterprisepack'}

#import users from csv or txt file
#$stuusers = import-csv -path c:\users\shueet1\desktop\training.csv

$stuusers = get-content "c:\users\shueet1\desktop\training.txt"

#assign licenses to users
foreach ($user in $stuusers)
{
 set-msoluserlicense -userprincipalname $\_.userprincipalname -licenseoptions $1xyz

}
get-content does not work like import-csv. it returns an array of strings, where each element corresponds to a line in the file.so  there is no $user.userprincipalname property, hence the null argument exception.if the training.txt file contains only an upn per line the correct syntax would be:$1xyz = new-msollicenseoptions -accountskuid "1xyz:enterprisepack" -disabledplans forms\_plan\_e3,stream\_o365\_e3,deskless,powerapps\_o365\_p2,teams1,yammer\_enterprise,rms\_s\_enterprise,mcostandard,projectworkmanagement
$stuusers = get-content "c:\users\shueet1\desktop\training.txt"
#assign licenses to users
foreach ($user in $stuusers)
{
 set-msoluserlicense -userprincipalname $user -licenseoptions $1xyz
}
thanks for your comment!

i definitely should’ve used mkshell, not sure why i wasn’t. it does seem to produce a different error:

make: entering directory '/build/source/doc/manual'

xsltproc --nonet --param section.autolabel 1 --param section.label.includes.component.label 1 --param html.stylesheet … your license should match the number of users on your system, so you may need to request a new license.

this command can be used to reset a password: <https://docs.mattermost.com/administration/command-line-tools.html#mattermost-user-password>. I have now implemented the following solution.


As CodeNotFound pointed out in the comments, IdentityUser used to have a `Roles` property. This is no longer the case in .NET Core. This [comment/issue](https://github.com/aspnet/Identity/issues/1361#issuecomment-348863959) on GitHub seems to be the current solution for .Net Core. I have attempted to implemented it with the following code:


**ApplicationUser**



```
public class ApplicationUser : IdentityUser
{
    public ICollection<ApplicationUserRole> UserRoles { get; set; }
}

```

**ApplicationUserRole**



```
public class ApplicationUserRole : IdentityUserRole<string>
{
    public virtual ApplicationUser User { get; set; }
    public virtual ApplicationRole Role { get; set; }
}

```

**ApplicationRole**



```
public class ApplicationRole : IdentityRole
{
    public ICollection<ApplicationUserRole> UserRoles { get; set; }
}

```

**DBContext**



```
public class ApplicationDbContext
    : IdentityDbContext<ApplicationUser, ApplicationRole, string, IdentityUserClaim<string>,
    ApplicationUserRole, IdentityUserLogin<string>,
    IdentityRoleClaim<string>, IdentityUserToken<string>>
{
    public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
        : base(options)
    {
    }

    protected override void OnModelCreating(ModelBuilder builder)
    {
        base.OnModelCreating(builder);

        builder.Entity<ApplicationUserRole>(userRole =>
        {
            userRole.HasKey(ur => new { ur.UserId, ur.RoleId });

            userRole.HasOne(ur => ur.Role)
                .WithMany(r => r.UserRoles)
                .HasForeignKey(ur => ur.RoleId)
                .IsRequired();

            userRole.HasOne(ur => ur.User)
                .WithMany(r => r.UserRoles)
                .HasForeignKey(ur => ur.UserId)
                .IsRequired();
        });
    }
}

```

**Startup**



```
services.AddIdentity<ApplicationUser, ApplicationRole>(options => options.Stores.MaxLengthForKeys = 128)
            .AddEntityFrameworkStores<ApplicationDbContext>()
            .AddDefaultTokenProviders();

```

Finally, make sure when you're using it that you eagerly load the User's UserRoles, and then the UserRole's Role like so:



```
this.Users = userManager.Users.Include(u => u.UserRoles).ThenInclude(ur => ur.Role).ToList();

```

I had an issue where the `Role` property of each `UserRole` was null and this was resolved by adding in the `.ThenInclude(ur => ur.Role)` part.


Microsoft doc on multi-level eager loading: <https://docs.microsoft.com/en-us/ef/core/querying/related-data#including-multiple-levels> this is because the /login page, once a login occurs, the ‘state’ parameter is missing and so when the page tries to call the /authorize url it will error. the state parameter is used to mitigate csrf attack and so during authentication, the application sends this parameter in the authorization … [image] soydepr:

certbot: error: unrecognized arguments: renewal

you should still be able to renew. the command is:

certbot-auto renew The clue is `Access denied for user 'homestead'@'localhost'`


Do you have a user called `homestead`? Have you attempted to grant them access to the database?


If you're unsure of the answers to either of those questions, I think you should re-read the documentation. oh my god … i have to appologize very, very much for wasting your time. as so often the problem is sitting in front of the screen :frowning:

i am using certbot inside a script where i make a backup of the /etc/letsencrypt folder, stops apache, on so on …

my mistake is, that my backup of /etc/letse… Hello,

 

 

We would like to inform you that decoding MCE errors is out of the scope of support for us. As a general recommendation based on the wording for the log, please check the memory modules installed and confirm if one of them has failed.
 
 
 
 
 
 
 
 
 

[View solution in original post](/t5/Server-Products/How-to-decode-MCE-errors/m-p/527769#M13599) Call statement Transfers control to a Sub procedure, Function procedure, or dynamic-link library (DLL)procedure.



I believe that you cannot use "CALL" to call a file which is not executable.  

same goes with SHELL...



Call Shell(AppName, 1) Where AppName contains the path of the Executable file.



try it with any other directory and try calling an executable.. it will work.



If you try calling a .txt or .bmp, it will give you the same error message... you can not configure or train the ocr software as end-user. my suggestion: for [number ocr use the ocr engine2](https://ocr.space/ocrapi#ocrengine) - it is usually better with numbers.