Pulling Serial Number from SMS_G_System_PC_BIOS : r/SCCM
I think your query is slow because it is going off to query the site database for a lot of information, Computer1 is just an example name of the machine you want to Query, so in your script you have a prompt to enter a computer which you want to query, -Computername. What happens if you just ran this on your machine, do you still get access denied?