The present invention relates to an aerosol-generating device (1) for generating an aerosol by dispersing an aerosol-forming powder (31) into an airflow. The device comprises a device housing (2) which comprises an airflow passage therethrough and which is configured to receive a capsule (30) that contains the aerosol-forming powder to be discharged into the airflow passage. The device further comprises a magnetic actuator (40) which is configured to generate a movement of the capsule when being received in the device housing for de-agglomerating the aerosol-forming powder within the capsule. The invention further relates to an aerosol-generating system comprising an aerosol-generating device according to the invention and an aerosol-forming powder containing capsule for use with the aerosol-generating device.