For the 1st problem, the value of the "-Identity" parameter contains a space. Surrounding the value with quotation marks (single or double) is necessary.
However, it's unlikely that "david klark" is an acceptable value for use an identifier. These are the types of values that can be used (taken from the help for the cmdlet):
-Identity
Specifies an Active Directory account object by providing one of the following property values.
The identifier in parentheses is the Lightweight Directory Access Protocol (LDAP) display name
for the attribute. The acceptable values for this parameter are:
. distinguished name
. GUID (objectGUID)
. security identifier (objectSid)
. SAM account name (sAMAccountName)
For the second problem, the date format may not be correct for the local sessions culture. While "8/30/2023" would be acceptable in the USA, if the culture for the session was Finnish that date format is incorrect. I didn't find a culture specific to Finland to know what an acceptable format might be.
One way around this is to not use an abbreviated representation of the date but to use the "Get-Date" cmdlet and the parameters "-Year", "-Month", and "-Day" to remove the ambiguity. For example:
$u = Get-ADUser -Filter "name -eq 'david klark'"
Set-ADAccountExpiration -Identity $u.distinguishedName -DateTime (Get-Date -Day 30 -Month 8 -Year 2023)
I hope the Google translation was accurate enough for me to understand your question.